8000 Apply i18n settings only if specified · arduino/arduino-cli@61d1f5b · GitHub
[go: up one dir, main page]

Skip to content

Commit 61d1f5b

Browse files
committed
Apply i18n settings only if specified
1 parent 40a4c90 commit 61d1f5b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

commands/instances.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ func (s *arduinoCoreServerImpl) Init(req *rpc.InitRequest, stream rpc.ArduinoCor
419419
// Refreshes the locale used, this will change the
420420
// language of the CLI if the locale is different
421421
// after started.
422-
i18n.Init(s.settings.GetString("locale"))
422+
if locale, ok, _ := s.settings.GetStringOk("locale"); ok {
423+
i18n.Init(locale)
424+
}
423425

424426
return nil
425427
}

commands/service.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,14 @@ import (
1919
"context"
2020

2121
"github.com/arduino/arduino-cli/internal/cli/configuration"
22-
"github.com/arduino/arduino-cli/internal/i18n"
2322
rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2423
"github.com/arduino/arduino-cli/version"
2524
)
2625

2726
// NewArduinoCoreServer returns an implementation of the ArduinoCoreService gRPC service
2827
// that uses the provided version string.
2928
func NewArduinoCoreServer() rpc.ArduinoCoreServiceServer {
30-
settings := configuration.NewSettings()
31-
32-
// Setup i18n
33-
i18n.Init(settings.Locale())
34-
35-
return &arduinoCoreServerImpl{settings: settings}
29+
return &arduinoCoreServerImpl{settings: configuration.NewSettings()}
3630
}
3731

3832
type arduinoCoreServerImpl struct {

0 commit comments

Comments
 (0)
0