WebAssembly / wasi-cli

Command-Line Interface (CLI) World for WASI
60 stars 11 forks source link

International environment #42

Open oovm opened 3 months ago

oovm commented 3 months ago

Is there some interface to determine the user's locale without reading the configuration file?

I hope my error message can automatically adapt according to the user's interface language.

Specifically, I need to read a string, and this string needs to be a legal icu4x locale.

Locale enumerations or structures are also welcome

pchickey commented 3 months ago

There is no defined support for locale this in the wasi-cli proposal, or any Wasi proposal that I am aware of. The wasi-cli environment variables can provide the linux-style LC_* variables, which may be enough to get your use case bootstrapped. Adding better support for locale is definitely worth considering as an addition to this proposal, but I don't have the expertise to champion that change - if you do, and want to take it on, we can talk more about how to get that going.