Skip to content

Commit 5ba6901

Browse files
committed
Fixed locales (translations) not being detected with default config
1 parent ac6ec6d commit 5ba6901

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Diff for: commands/service_settings_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func TestGetAll(t *testing.T) {
6262
"user": `+defaultUserDir.GetEncodedValue()+`
6363
},
6464
"library": {},
65-
"locale": "en",
6665
"logging": {
6766
"format": "text",
6867
"level": "info"

Diff for: internal/cli/configuration/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func SetDefaults(settings *Settings) {
7373
setKeyTypeSchema("network.user_agent_ext", "")
7474

7575
// locale
76-
setDefaultValueAndKeyTypeSchema("locale", "en")
76+
setKeyTypeSchema("locale", "")
7777
}
7878

7979
// InjectEnvVars change settings based on the environment variables values

Diff for: internal/integrationtest/config/config_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -931,3 +931,16 @@ func TestConfigViaEnvVars(t *testing.T) {
931931
require.NoError(t, err)
932932
require.Equal(t, "20\n\n", string(out))
933933
}
934+
935+
func TestI18N(t *testing.T) {
936+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
937+
defer env.CleanUp()
938+
939+
out, _, err := cli.RunWithCustomEnv(map[string]string{"LANG": "it"})
940+
require.NoError(t, err)
941+
require.Contains(t, string(out), "Comandi disponibili")
942+
943+
out, _, err = cli.RunWithCustomEnv(map[string]string{"LANG": "en"})
944+
require.NoError(t, err)
945+
require.Contains(t, string(out), "Available Commands")
946+
}

0 commit comments

Comments
 (0)