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 61d1f5b

Browse filesBrowse files
committed
Apply i18n settings only if specified
1 parent 40a4c90 commit 61d1f5b
Copy full SHA for 61d1f5b

File tree

Expand file treeCollapse file tree

2 files changed

+4
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-8
lines changed

‎commands/instances.go

Copy file name to clipboardExpand all lines: commands/instances.go
+3-1Lines 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

Copy file name to clipboardExpand all lines: commands/service.go
+1-7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.