Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5ba6901

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

File tree

3 files changed

+14
-2
lines changed
Filter options

3 files changed

+14
-2
lines changed

‎commands/service_settings_test.go

Copy file name to clipboardExpand all lines: commands/service_settings_test.go
-1Lines changed: 0 additions & 1 deletion
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"

‎internal/cli/configuration/defaults.go

Copy file name to clipboardExpand all lines: internal/cli/configuration/defaults.go
+1-1Lines changed: 1 addition & 1 deletion
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

‎internal/integrationtest/config/config_test.go

Copy file name to clipboardExpand all lines: internal/integrationtest/config/config_test.go
+13Lines changed: 13 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.