Skip to content

Commit 9c3ddd1

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

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

internal/cli/configuration/defaults.go

Lines 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

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy