1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +01:00

Moved translations outside of the binary

This commit is contained in:
Martin Tůma 2018-02-08 18:16:44 +01:00
parent 331cb48e11
commit 4b64ee467c
5 changed files with 55 additions and 8 deletions

View File

@ -20,10 +20,5 @@
<file>icons/system-run.png</file>
<file>icons/document-print-preview.png</file>
<file>icons/view-filter.png</file>
<file>lang/gpxsee_cs.qm</file>
<file>lang/gpxsee_sv.qm</file>
<file>lang/gpxsee_de.qm</file>
<file>lang/gpxsee_ru.qm</file>
<file>lang/gpxsee_fi.qm</file>
</qresource>
</RCC>

View File

@ -196,6 +196,29 @@ Section "ANGLE" SEC_ANGLE
SectionEnd
SectionGroup "Localization" SEC_LOCALE
Section "Czech"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_cs.qm locale\gpxsee_cs.qm
SectionEnd
Section "German"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_de.qm locale\gpxsee_de.qm
SectionEnd
Section "Finish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fi.qm locale\gpxsee_fi.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_ru.qm locale\gpxsee_ru.qm
SectionEnd
Section "Swedish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_sv.qm locale\gpxsee_sv.qm
SectionEnd
SectionGroupEnd
;--------------------------------
; Uninstaller
@ -247,6 +270,8 @@ 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} \
"Localization"
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
@ -255,4 +280,5 @@ LangString DESC_APP ${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_FUNCTION_DESCRIPTION_END

View File

@ -198,6 +198,29 @@ Section "ANGLE" SEC_ANGLE
SectionEnd
SectionGroup "Localization" SEC_LOCALE
Section "Czech"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_cs.qm locale\gpxsee_cs.qm
SectionEnd
Section "German"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_de.qm locale\gpxsee_de.qm
SectionEnd
Section "Finish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_fi.qm locale\gpxsee_fi.qm
SectionEnd
Section "Russian"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_ru.qm locale\gpxsee_ru.qm
SectionEnd
Section "Swedish"
CreateDirectory "$INSTDIR\locale"
File /oname=locale\gpxsee_sv.qm locale\gpxsee_sv.qm
SectionEnd
SectionGroupEnd
;--------------------------------
; Uninstaller
@ -250,6 +273,8 @@ 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} \
"Localization"
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
@ -258,4 +283,5 @@ LangString DESC_APP ${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_FUNCTION_DESCRIPTION_END
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALE} $(DESC_LOCALE)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -19,8 +19,7 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
_argc(argc), _argv(argv)
{
QTranslator *gpxsee = new QTranslator(this);
QString locale = QLocale::system().name();
gpxsee->load(QString(":/lang/gpxsee_") + locale);
gpxsee->load(QLocale::system(), "gpxsee", "_", LOCALE_DIR);
installTranslator(gpxsee);
QTranslator *qt = new QTranslator(this);

View File

@ -41,5 +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")
#endif /* CONFIG_H */