Does Babel allow to detect the proper locale on non POSIX operating system. Had a look at the code and can't figure out if Babel is POSIX only.
Working on a desktop application, the translation file does not get loaded according to the user preferred languages.
Activity
akx commentedon Jan 26, 2022
The
default_locale()function definitely only looks as the posixesque environment variable keys.macOS is a POSIX OS, but it might well be that the environment variables don't get set according to the user's locale preferences.
A PR to enhance
default_locale()for cross-platform use is welcome.jeanas commentedon Oct 16, 2023
Can't you use locale.getlocale? (I don't have a Windows machine to check what it does there, but I think it works.)
akx commentedon May 7, 2024
Closing as stale.
ikus060 commentedon May 21, 2024
I came up with something like this in my application to load the proper language file for Windows and MacOS.