- Allow translating texts before before Window is created
-> Translate help text
- Use AboutDialog instead of message box on Windows when starting GUI with -v
The Polish translation doesn't have any translated text. So it is
only waste of resources to have it available. And it may confuse
some people who try it.
Ticket #4008 (GUI: Polish translation does not translate and should be removed)
Ln pointed out in IRC that 'se' is not ISO-639 name of the Swedish,
but 'sv' is. So rename the translation file to use the correct
ISO-639 name. This wrong name also probably caused the GUI not
recognizing Swedish locale of the OS.
If there were unknown language in settings the fallback to English
language didn't work as expected. And there were no proper current
language set after that. Initialize current language to English
so we always have English as proper fallback.
GUI was storing selected language as index to the languages list.
This is fragile since the order and count of items can change.
This commit changes to using ISO language code (e.g. "en" for
"English").
Fixes ticket #2446 (GUI: Don't use index number for language selection)
Instead of separate language name and filename lists use one
list of structs. This makes language name and filename more
connected and makes handling of them easier.
Settings-dialog is more natural place for language selection than
the main menu. We also have more space and freedom there to have
longer text etc to make the selection easier (menus are quite limited
controls).
Allthough I put it after QTranslator had failed to load the translation.
This still allows QTranslator to try and open the file with several
variations of the file. To user we'll tell that the default file is missing.
It was missing the file extension and QTranslator returns false
if it was unable to find the translation file which is just as good.
QTranslator can also check for several variations of the given filename.
Also added QSetting value names to common.h
Work is halfway on both translations and .ui files.
I added a very quick and rough finnish translation.
The program now requires the translation files to be created before running
that can be done with lrelease gui.pro.
To compile the whole GUI one must do the following
cd gui
qmake
lrelease gui.pro
make