whoami icon indicating copy to clipboard operation
whoami copied to clipboard

Language Handling

Open AldaronLau opened this issue 2 years ago • 3 comments

Currently, on Unix-like platforms for English speakers in the US, something along the lines of ["en-US", "en"] will be reported by lang(). On Windows, just ["en-US"] will be reported. How should language fallbacks be expected to be handled? It would be nice to have some kind of consistency here.

AldaronLau avatar Dec 26 '22 23:12 AldaronLau

Not sure on exact language tags, but for example, if the user prefers ["en-CN", "en-GB", "zh-CN"], then I'm assuming that if all else fails, they would prefer next (for fallback) ["en", "zh"] (requesting any dialect for English first, then any dialect of Chinese second). But, the question is whether or not whoami should append these any dialect language codes?

AldaronLau avatar Dec 26 '22 23:12 AldaronLau

I think the answer to this question depends on whether or not it's supported to select "any" dialect from the OS dialogues (needs some research).

AldaronLau avatar Dec 28 '22 05:12 AldaronLau

Upon further research it appears as though it's possible to select "any", at least on Linux. WhoAmI should not automatically insert the language without the dialect. Although, since it is a fallback list, any dialect could be appended at the end of the list:

["en-CN", "en-GB", "zh-CN"] -> ["en-CN", "en-GB", "zh-CN", "en", "zh"]
["en-CN", "en", "zh-CN"] -> ["en-CN", "en", "zh-CN", "zh"]

AldaronLau avatar Nov 13 '23 17:11 AldaronLau