From 423f20b11f910111f406879c5c3aa05886b339c7 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Fri, 3 Nov 2023 23:52:54 +0100 Subject: [PATCH] lib: set locale per cli --- doc/api/cli.md | 15 +++ src/node.cc | 4 + src/node_i18n.cc | 17 +++ src/node_i18n.h | 2 + src/node_options.cc | 5 + src/node_options.h | 1 + test/parallel/test-icu-locale.js | 179 +++++++++++++++++++++++++++++++ 7 files changed, 223 insertions(+) create mode 100644 test/parallel/test-icu-locale.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 5f29c497426db6..7503c3dea1b98f 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1138,6 +1138,19 @@ surface on other platforms, but the performance impact may be severe. This flag is inherited from V8 and is subject to change upstream. It may disappear in a non-semver-major release. +### `--locale` + + + +Set the default locale used by ICU (`Intl` object). It expects a string +representing the language version as defined in [RFC 5646][] (also known as +BCP 47). (Overrides `LOCALE`.) + +Examples of valid language codes include "en", "en-US", "fr", "fr-FR", "es-ES", +etc. + ### `--max-http-header-size=size`