Force to use EN locale

Hi, All!
How can I to force Arduino-Cli to use "en" locale (not OS Locale)?

package i18n

// Init initializes the i18n module, setting the locale according to this order of preference:
// 1. Locale specified via the function call
// 2. OS Locale
// 3. en (default)

Hi @diakin. Unfortunately we have not documented it yet, but the localization of Arduino CLI can be controlled via the locale configuration key.

There are currently two different ways to set that key:

Arduino CLI configuration file

This will be the best option for setting the locale persistently.

The configuration file system is documented here:

If you are using the YAML format of the default arduino-cli.yaml file, you would open it in a text editor and add this line:

locale: en

Environment variable

This is convenient if you only want to set the locale temporarily, but it might also be a good option to set it persistently in a manner that would affect Arduino CLI universally on your system (in case you have multiple Arduino CLI configuration files that might be active at different times).

The environment variable configuration system is documented here:

On Windows, if using the cmd command prompt, you would run this command:


On Windows, if using PowerShell, you would run this command:


On Linux, macOS, or even a Bash terminal on Windows, you would run this command:


Please let me know if you have any problems or questions.

Regards, Per

Thank you very much, Per!
arduino-cli.yaml method works fine!

Is the way to do it something like in this example
"arduino-cli config set logging.level trace" ?
"arduino-cli config set locale en" says "Settings key doesn't exist"

You are welcome. I'm glad it is working now.

Yeah, I meant to mention that but I forgot by the time I made the post. Unfortunately it seems the support for the locale key is missing from the arduino-cli config commands.

I also ran into this. I put it on my "to do" list to try to work on or at least submit a report, but I haven't found the time yet. At the time we still hadn't actually done the localization because we were still working on getting the internationalization infrastructure in place to make that possible so there really wasn't any need to control the locale. But now that initiative is well along and proper support for the configuration is essential.

Thank you!
Really, arduino-cli.yaml method works fine for me.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.