1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Properly load QT translations on windows

This commit is contained in:
Martin Tůma 2018-02-09 21:04:37 +01:00
parent 152828042f
commit 2b6d3799ec
6 changed files with 59 additions and 46 deletions

View File

@ -42,7 +42,7 @@ build_script:
xcopy pkg\maps installer\maps /i
xcopy lang\*.qm installer\locale\ /sy
xcopy lang\*.qm installer\translations\ /sy
copy licence.txt installer

View File

@ -256,7 +256,7 @@
<message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/>
<source>%1 is not writable.</source>
<translation>%1 n'est pas inscriptible.</translation>
<translation>%1 n&apos;est pas inscriptible.</translation>
</message>
</context>
<context>
@ -297,7 +297,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="562"/>
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
<translation>GPXSee est distribué selon les termes de la licence publique générale GNU (version 3). Pour plus d'information sur GPXSee, visiter le site du projet sur </translation>
<translation>GPXSee est distribué selon les termes de la licence publique générale GNU (version 3). Pour plus d&apos;information sur GPXSee, visiter le site du projet sur </translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="617"/>
@ -327,7 +327,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="625"/>
<source>User override directory:</source>
<translation>Dossier de l'utilisateur :</translation>
<translation>Dossier de l&apos;utilisateur :</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="634"/>
@ -412,7 +412,7 @@
<location filename="../src/GUI/gui.cpp" line="613"/>
<location filename="../src/GUI/gui.cpp" line="614"/>
<source>Paths</source>
<translation>Chemin d'accès</translation>
<translation>Chemin d&apos;accès</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="244"/>
@ -469,7 +469,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="348"/>
<source>Show toolbars</source>
<translation>Afficher la barre d'outils</translation>
<translation>Afficher la barre d&apos;outils</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="354"/>
@ -560,7 +560,7 @@
<message>
<location filename="../src/GUI/gui.cpp" line="463"/>
<source>Units</source>
<translation>Système d'unités</translation>
<translation>Système d&apos;unités</translation>
</message>
<message>
<location filename="../src/GUI/gui.cpp" line="472"/>
@ -908,7 +908,7 @@
<location filename="../src/GUI/optionsdialog.cpp" line="110"/>
<location filename="../src/GUI/optionsdialog.cpp" line="192"/>
<source>Use anti-aliasing</source>
<translation>Utiliser l'anticrénelage</translation>
<translation>Utiliser l&apos;anticrénelage</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="189"/>
@ -933,7 +933,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="212"/>
<source>Background color:</source>
<translation>Couleur d'arrière plan :</translation>
<translation>Couleur d&apos;arrière plan :</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="223"/>
@ -1145,12 +1145,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="351"/>
<source>The printed area is approximately the display area. The map zoom level does not change.</source>
<translation>La zone d'impression est presque celle affichée. L'échelle reste la même.</translation>
<translation>La zone d&apos;impression est presque celle affichée. L&apos;échelle reste la même.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="353"/>
<source>The zoom level will be changed so that the whole content (tracks/waypoints) fits to the printed area and the map resolution is as close as possible to the print resolution.</source>
<translation>L'échelle est ajustée pour que tout le contenu (traces et points de jalonnement) rentre dans la zone d'impression tout en gardant proches les résolutions d'impression et de carte.</translation>
<translation>L&apos;échelle est ajustée pour que tout le contenu (traces et points de jalonnement) rentre dans la zone d&apos;impression tout en gardant proches les résolutions d&apos;impression et de carte.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="375"/>
@ -1180,7 +1180,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="385"/>
<source>Item count (&gt;1)</source>
<translation>Nombre d'éléments (&gt;1)</translation>
<translation>Nombre d&apos;éléments (&gt;1)</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="400"/>
@ -1190,7 +1190,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="410"/>
<source>Print mode</source>
<translation>Mode d'impression</translation>
<translation>Mode d&apos;impression</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="411"/>
@ -1499,4 +1499,3 @@
</message>
</context>
</TS>

View File

@ -196,30 +196,35 @@ Section "ANGLE" SEC_ANGLE
SectionEnd
SectionGroup "Localization" SEC_LOCALE
SectionGroup "Localization" SEC_LOCALIZATION
Section "Czech"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_cs.qm locale\gpxsee_cs.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
File /oname=translations\qt_cs.qm translations\qt_cs.qm
SectionEnd
Section "Finnish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fi.qm locale\gpxsee_fi.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
File /oname=translations\qt_fi.qm translations\qt_fi.qm
SectionEnd
Section "French"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fr.qm locale\gpxsee_fr.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
File /oname=translations\qt_fr.qm translations\qt_fr.qm
SectionEnd
Section "German"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_de.qm locale\gpxsee_de.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
File /oname=translations\qt_de.qm translations\qt_de.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_ru.qm locale\gpxsee_ru.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
File /oname=translations\qt_ru.qm translations\qt_ru.qm
SectionEnd
Section "Swedish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_sv.qm locale\gpxsee_sv.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
SectionEnd
SectionGroupEnd
@ -274,7 +279,7 @@ LangString DESC_ANGLE ${LANG_ENGLISH} \
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
LangString DESC_APP ${LANG_ENGLISH} \
"GPXSee application"
LangString DESC_LOCALE ${LANG_ENGLISH} \
LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
"Localization"
;Assign language strings to sections
@ -284,5 +289,5 @@ LangString DESC_LOCALE ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALE} $(DESC_LOCALE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -198,30 +198,35 @@ Section "ANGLE" SEC_ANGLE
SectionEnd
SectionGroup "Localization" SEC_LOCALE
SectionGroup "Localization" SEC_LOCALIZATION
Section "Czech"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_cs.qm locale\gpxsee_cs.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_cs.qm translations\gpxsee_cs.qm
File /oname=translations\qt_cs.qm translations\qt_cs.qm
SectionEnd
Section "Finnish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fi.qm locale\gpxsee_fi.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_fi.qm translations\gpxsee_fi.qm
File /oname=translations\qt_fi.qm translations\qt_fi.qm
SectionEnd
Section "French"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fr.qm locale\gpxsee_fr.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_fr.qm translations\gpxsee_fr.qm
File /oname=translations\qt_fr.qm translations\qt_fr.qm
SectionEnd
Section "German"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_de.qm locale\gpxsee_de.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_de.qm translations\gpxsee_de.qm
File /oname=translations\qt_de.qm translations\qt_de.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_ru.qm locale\gpxsee_ru.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_ru.qm translations\gpxsee_ru.qm
File /oname=translations\qt_ru.qm translations\qt_ru.qm
SectionEnd
Section "Swedish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_sv.qm locale\gpxsee_sv.qm
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_sv.qm translations\gpxsee_sv.qm
SectionEnd
SectionGroupEnd
@ -277,7 +282,7 @@ LangString DESC_ANGLE ${LANG_ENGLISH} \
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
LangString DESC_APP ${LANG_ENGLISH} \
"GPXSee application"
LangString DESC_LOCALE ${LANG_ENGLISH} \
LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
"Localization"
;Assign language strings to sections
@ -287,5 +292,5 @@ LangString DESC_LOCALE ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALE} $(DESC_LOCALE)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -19,12 +19,16 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
_argc(argc), _argv(argv)
{
QTranslator *gpxsee = new QTranslator(this);
gpxsee->load(QLocale::system(), "gpxsee", "_", LOCALE_DIR);
gpxsee->load(QLocale::system(), "gpxsee", "_", TRANSLATIONS_DIR);
installTranslator(gpxsee);
QTranslator *qt = new QTranslator(this);
#ifdef Q_OS_WINDOWS
qt->load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
#else // Q_OS_WINDOWS
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
QLibraryInfo::TranslationsPath));
#endif // Q_OS_WINDOWS
installTranslator(qt);
#ifdef Q_OS_MAC

View File

@ -41,6 +41,6 @@
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
#define TILES_DIR USER_DIR + QString("/tiles")
#define LOCALE_DIR GLOBAL_DIR + QString("/locale")
#define TRANSLATIONS_DIR GLOBAL_DIR + QString("/locale")
#endif /* CONFIG_H */