Skip to content

Arduino CLI locale not configured by default #1636

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

Open
3 tasks done
per1234 opened this issue Nov 4, 2022 · 0 comments
Open
3 tasks done

Arduino CLI locale not configured by default #1636

per1234 opened this issue Nov 4, 2022 · 0 comments
Labels
topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Nov 4, 2022

Describe the problem

Arduino IDE 2.x has been localized to 17 languages thanks to the amazing work of the community translators.

Output exposed to Arduino IDE users when performing various operations often originates from the strings defined in the Arduino CLI codebase. These strings have also been localized. Arduino CLI must be configured by Arduino IDE to use the locale set in the "Language" field of the Arduino IDE preferences dialog.

By default, the Arduino IDE 2.x user interface is localized to English.

🐛 Arduino IDE 2.x does not configure the Arduino CLI locale by default, so Arduino CLI uses the system locale, resulting in inconsistent localization of the strings shown the Arduino IDE 2.x user interface.

image

To reproduce

  1. Set your system locale to a non-English language that Arduino CLI has significant translation coverage for:
    https://explore.transifex.com/arduino-1/arduino-cli/

  2. Select File > Quit from the Arduino IDE menus if it is running.

  3. Delete the following folders to adequately simulate a fresh installation of Arduino IDE 2.x:
    Windows:

    • %HOMEPATH%\.arduinoIDE\
      

      (e.g., C:\Users\<username>\.arduinoIDE\)

    • %APPDATA%\arduino-ide\
      

      (e.g., C:\Users\<user name>\AppData\Roaming\arduino-ide\)

    Linux:

    • ~/.arduinoIDE/
      
    • ~/.config/arduino-ide/
      

    macOS:

    • ~/.arduinoIDE/
      
    • ~/Library/Application Support/arduino-ide/
      
  4. Start Arduino IDE.
    🙂 The UI is localized according to the locale set in the "Language" field of the Arduino IDE "Preferences" dialog (which defaults to "English").

  5. Compile any sketch for any board.

  6. Wait for the compilation to finish.
    🐛 The output originating from Arduino CLI in the "Output" view is localized according to the system locale setting.

  7. Select File > Preferences... from the Arduino IDE menus.

  8. Select any language other than "English" from the "Language" menu.

  9. Click the OK button.

  10. Select File > Preferences... from the Arduino IDE menus.

  11. Select "English" from the "Language" menu.

  12. Click the OK button.

  13. Compile any sketch for any board.

  14. Wait for the compilation to finish.
    🙂 The output originating from Arduino CLI in the "Output" view is localized according to the locale set in the "Language" field of the Arduino IDE "Preferences" dialog.

Expected behavior

Arduino CLI locale configuration always matches the Arduino IDE locale configuration.

Arduino IDE version

Original report

b998d35

Last verified with

2.2.1

Operating system

  • Linux
  • Windows

Operating system version

  • Ubuntu 20.04
  • Windows 11

Additional context

Arduino CLI locale is configured via the locale key in the arduino-cli.yaml configuration file:

https://arduino.github.io/arduino-cli/dev/configuration/


A source of potential confusion is that one of the log entries does show a locale setting even though none is set in the arduino-cli.yaml file:

2023-09-12T22:32:49.801Z config INFO Mapped the CLI configuration: {"dataDirUri":"file:///c%3A/Users/per/AppData/Local/Arduino15","sketchDirUri":"file:///c%3A/Users/per/Documents/Arduino","additionalUrls":[],"network":"none","locale":"en"}

Originally reported by @CptHolzschnauz at #1614 (comment)

Related


Keywords

  • localization

  • localized

  • l10n

  • internationalization

  • internationalized

  • i18n

  • translate

  • translation

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: CLI Related to Arduino CLI labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant