8000 Fixed locales (translations) not being detected with default config by cmaglie · Pull Request #2724 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Fixed locales (translations) not being detected with default config #2724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed locales (translations) not being detected with default config
  • Loading branch information
cmaglie committed Nov 6, 2024
commit 1625f0c1cf1d49b94f50b68a08b5104a8fc8e80c
1 change: 0 additions & 1 deletion commands/service_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func TestGetAll(t *testing.T) {
"user": `+defaultUserDir.GetEncodedValue()+`
},
"library": {},
"locale": "en",
"logging": {
"format": "text",
"level": "info"
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/configuration/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func SetDefaults(settings *Settings) {
setKeyTypeSchema("network.user_agent_ext", "")

// locale
setDefaultValueAndKeyTypeSchema("locale", "en")
setKeyTypeSchema("locale", "")
}

// InjectEnvVars change settings based on the environment variables values
Expand Down
13 changes: 13 additions & 0 deletions internal/integrationtest/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,3 +931,16 @@ func TestConfigViaEnvVars(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "20\n\n", string(out))
}

func TestI18N(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

out, _, err := cli.RunWithCustomEnv(map[string]string{"LC_ALL": "it"})
require.NoError(t, err)
require.Contains(t, string(out), "Comandi disponibili")

out, _, err = cli.RunWithCustomEnv(map[string]string{"LC_ALL": "en"})
require.NoError(t, err)
require.Contains(t, string(out), "Available Commands")
}
0