New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux support #18
Conversation
@bratan |
@bratan |
@proninyaroslav - The output is wrong in Ubuntu 22.04 |
@bratan |
@bratan |
@proninyaroslav - This seems to fix the issue and display correctly the locale: Is there any downside in using LC_CTYPE instead of LC_ALL? |
@bratan So, |
I`ve run the app with VSCode, bash terminal, zsh terminal, same output everywhere. Basically the issue is that LC_ALL is not set and from what I could find, the solutions are generally to explicitly set LC_ALL in /etc/environment or other places, however this might not be a good solution since it requires manual intervention from the end-user. |
It's also not set in the image that I tested, but I sent you the screenshot above, which shows that it works properly and displays the locale, not something weird like |
I think one solution would be to get the |
@bratan
So I make this: if |
@proninyaroslav - Good solution, seems to be working well now. Thanks. |
std::setlocale is used to get the current locale. Since GNU/Linux and POSIX doesn't provide a standard API for getting the preferred languages,
DeviceLocale.getPreferredLocales
always returns the current locale. This is stated in the README. The code has been tested and works as expected.Screenshots: