From d5c4495991312b69bbd844d7757f7127ffc8482c Mon Sep 17 00:00:00 2001 From: Patrick Pacher Date: Wed, 13 Sep 2023 10:27:29 +0200 Subject: [PATCH] core: add core/localeID setting to configure formating of dates, currencies and numbers for the user interface --- core/config.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/core/config.go b/core/config.go index 31eb3c28..7a549409 100644 --- a/core/config.go +++ b/core/config.go @@ -13,6 +13,8 @@ var ( CfgNetworkServiceKey = "core/networkService" defaultNetworkServiceMode bool + + CfgLocaleKey = "core/localeID" ) func init() { @@ -41,5 +43,32 @@ func registerConfig() error { return err } + if err := config.Register(&config.Option{ + Name: "Locale", + Key: CfgLocaleKey, + Description: "Configures the locale for the user interface. This mainly affects rendering of dates, currency and numbers. Note that the Portmaster does not yet support different languages.", + OptType: config.OptTypeString, + ExpertiseLevel: config.ExpertiseLevelUser, + ReleaseLevel: config.ReleaseLevelStable, + DefaultValue: "en-GB", + PossibleValues: []config.PossibleValue{ + { + Name: "en-GB", + Value: "en-GB", + }, + { + Name: "en-US", + Value: "en-US", + }, + }, + Annotations: config.Annotations{ + config.CategoryAnnotation: "User Interface", + config.DisplayHintAnnotation: config.DisplayHintOneOf, + config.RequiresUIReloadAnnotation: true, + }, + }); err != nil { + return err + } + return nil }