Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[breaking] Pass user locale preference directly to i18n package (#1365)
The user can configure their locale preference via the `locale` configuration key. This information is given priority by
the `github.com/arduino/arduino-cli/configuration` package over the automatically detected locale.
Previously, the `i18n` package got the configuration setting from the `github.com/arduino/arduino-cli/configuration`
package, but this will result in an import cycle when the `i18n` package is used to enable translation of the output
strings of the `configuration` package.
To avoid this, the caller now reads the configuration and passes the locale code to the `i18n` package via its `Init`
function:
i18n.Init("it")
The argument can be omitted if only automated locale detection is needed:
i18n.Init()- Loading branch information
Showing
with
24 additions
and 7 deletions.
- +15 −0 docs/UPGRADING.md
- +8 −6 i18n/i18n.go
- +1 −1 main.go
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

