Skip to content

Arduino CLI locale not configured by default #1636

Open
@per1234

Description

@per1234

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: CLIRelated to Arduino CLItopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions