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

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
Prev Previous commit
Next Next commit
Apply i18n settings only if specified
  • Loading branch information
cmaglie committed Nov 6, 2024
commit 9d9afb8434ff07966cf2b9cd966bac9e542f2dab
4 changes: 3 additions & 1 deletion 4 commands/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,9 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
// Refreshes the locale used, this will change the
// language of the CLI if the locale is different
// after started.
i18n.Init(s.settings.GetString("locale"))
if locale, ok, _ := s.settings.GetStringOk("locale"); ok {
i18n.Init(locale)
}

return nil
}
Expand Down
8 changes: 1 addition & 7 deletions 8 commands/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@ import (
"context"

"github.com/arduino/arduino-cli/internal/cli/configuration"
"github.com/arduino/arduino-cli/internal/i18n"
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
"github.com/arduino/arduino-cli/version"
)

// NewArduinoCoreServer returns an implementation of the ArduinoCoreService gRPC service
// that uses the provided version string.
func NewArduinoCoreServer() rpc.ArduinoCoreServiceServer {
settings := configuration.NewSettings()

// Setup i18n
i18n.Init(settings.Locale())

return &arduinoCoreServerImpl{settings: settings}
return &arduinoCoreServerImpl{settings: configuration.NewSettings()}
}

type arduinoCoreServerImpl struct {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.