mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Change i18n to just use single language setting
This commit is contained in:
@@ -110,10 +110,6 @@ func (r *mutationResolver) ConfigureInterface(ctx context.Context, input models.
|
||||
config.Set(config.Language, *input.Language)
|
||||
}
|
||||
|
||||
if input.Locale != nil {
|
||||
config.Set(config.Locale, *input.Locale)
|
||||
}
|
||||
|
||||
css := ""
|
||||
|
||||
if input.CSS != nil {
|
||||
|
||||
@@ -57,7 +57,6 @@ func makeConfigInterfaceResult() *models.ConfigInterfaceResult {
|
||||
showStudioAsText := config.GetShowStudioAsText()
|
||||
css := config.GetCSS()
|
||||
cssEnabled := config.GetCSSEnabled()
|
||||
locale := config.GetLocale()
|
||||
language := config.GetLanguage()
|
||||
|
||||
|
||||
@@ -70,6 +69,5 @@ func makeConfigInterfaceResult() *models.ConfigInterfaceResult {
|
||||
CSS: &css,
|
||||
CSSEnabled: &cssEnabled,
|
||||
Language: &language,
|
||||
Locale: &locale,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ const ExternalHost = "external_host"
|
||||
|
||||
// i18n
|
||||
const Language = "language"
|
||||
const Locale = "locale"
|
||||
|
||||
// Interface options
|
||||
const SoundOnPreview = "sound_on_preview"
|
||||
@@ -106,18 +105,7 @@ func GetLanguage() string {
|
||||
|
||||
// default to English
|
||||
if ret == "" {
|
||||
return "en"
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func GetLocale() string {
|
||||
ret := viper.GetString(Locale)
|
||||
|
||||
// default to US
|
||||
if ret == "" {
|
||||
return "US"
|
||||
return "en-US"
|
||||
}
|
||||
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user