Add language combobox to the Preferences menu#187
Conversation
|
Seems to work quite good, just a question as I'm not really into the code here. Can we have also an combobox entry to "revert" back to the system locale detected language? |
|
Hmm the initial code had a "System Language" entry, but I removed it for some reason I cannot recall now. But I'll put it back, I think it makes sense to have it. |
|
(closed by accident) 😁 |
|
Oh, I remember the doubts I had when I removed this option. For the first case, supposing that the language is German, I thought that it would be more informative to just show "German" selected instead of "System Language", because there's a German translation and the application would be in German. For the second case, I thought that showing "English" right away instead of "System Language" would also be more informative because it indicates clearly that there's no translation in the user's language and that it has defaulted to English. And the language names will always be in English. This was meant to prevent cases where the users couldn't find their languages because the program somehow started in a strange language (perhaps it would be better to show the name of the languages in the native version?). (BTW, I have to add some comments to the code about this). |
|
Ok, kinda makes sense to me, just wanted to have something to go back to the default language. I would go with the native version. You wouldn't select it if you don't understand it. |
|
Interesting stuff. I guess we'll find out how well it fits real world usage... by getting people to use it, then lets tweak from there if needed? 😄 |
The behavior remains basically as before: when first launched the application will try to load a translation for the user's locale, and if one cannot be found it defaults to English. The difference is that now this is remembered so that upon further launches the program will go straight to the matching locale. See issue #182.
This allows the file to be included in the language box (Qt wasn't recognizing the "cn" suffix as a valid locale).
This allows the languages to be loaded when the user is running the app from another directory (e.g. when the app is run from an exported path).
|
@rp- I reverted the changes but unfortunately using the native version turned out to be a no can do. That would break compatibility as the methods were introduced in Qt 4.8. That's right, @justinclift, the user is the ultimate tester I guess 😄 |
|
I agree with @justinclift to get this to real world usage and, besides, the code quality is very good - so I really don't see any objections not to merge this :) Nice work, @Samir-Aguiar 👍 If you're interested in doing more coding work you're absolutely welcome to - if you should need any assistance or inspiration on which areas to work on, feel free to ask us any time! Regarding the default language option: Maybe a compromise would be to keep the list as it is, but append the string ' (system language)' to the list entry corresponding to the detected system language, or the string ' (fallback language)' to the list item for the English language when there is no translation available for the system language. Maybe one could even move this marked item to the top of the list or so to make it even clearer. |
Add language combobox to the Preferences menu
|
@MKleusberg Ahh yeah, those sound like good ways to indicate when a language is the system one, fall back one, and that kind of thing. 😄 |
|
Thanks @MKleusberg! And appending those strings is a great idea -- I'll do some tests later. |
|
@Samir-Aguiar Awesome 😄 I'll just open new issues with suggestions as soon as I remember them. But pick any issue you like to work on :) |
In addition, the new tab that I created also holds the "default location" option as suggested by @MKleusberg.
I've also renamed the Chinese translation file because the program was not finding it (see QTranslator::load() for the patterns used when looking for translation files).