Change i18n to just use single language setting

This commit is contained in:
Infinite
2020-02-08 22:02:07 +01:00
parent e6d9d385a7
commit 3a0420b79e
10 changed files with 13 additions and 61 deletions

View File

@@ -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 {

View File

@@ -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,
}
}

View File

@@ -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