Not sure why I am having so many problems in something which looks very straightforward.
Nothing really seems to work.
[image: b0f3e8c1-3c1d-40c6-9ad7-168ea335d4db.png]
The only time that I have been successful in the User Interface displaying a non-default translation language was with QLocale::setDefault. I believe that I am just going to go and try with this approach. My overall language detection logic in main.cpp is going to be something like:
0. Check if user has already explicitly set an application language
If that is the case, skip to step 3
This information is going to be stored in an external configuration file outside the application.
1. Detect user's default locale with QLocale::QLocale()
2. Check if user's default locale has an available translation in the application
If they do not, either do nothing else, or explicitly change the current locale to match with the default translation language (for the sake of readability)
I need to think exactly how I am going to match the results but QLocale has both QLocale::language() and QLocale::name() and that should be more than enough.
3. Change default locale to expected locale using QLocale::setDefault
I am not planning in adding my languages to my application. So, I am not really worried about having a big switch statement.