From d75db83442a01dcd003ea39a5ec61baad7d344a0 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 02:06:58 +0200 Subject: Change translation system to work more out of the box. using ./update-locales.sh now removes any old/obsolete translations. --- locales/bin/de_DE.qm | Bin 11585 -> 0 bytes locales/bin/es_ES.qm | Bin 417 -> 0 bytes locales/bin/main_en.qm | Bin 310 -> 0 bytes rwa-support-desktopapp.pro | 3 ++- src/main.cpp | 5 +++-- update_locales.sh | 5 ++--- 6 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 locales/bin/de_DE.qm delete mode 100644 locales/bin/es_ES.qm delete mode 100644 locales/bin/main_en.qm diff --git a/locales/bin/de_DE.qm b/locales/bin/de_DE.qm deleted file mode 100644 index 23c2d18..0000000 Binary files a/locales/bin/de_DE.qm and /dev/null differ diff --git a/locales/bin/es_ES.qm b/locales/bin/es_ES.qm deleted file mode 100644 index 0bed16b..0000000 Binary files a/locales/bin/es_ES.qm and /dev/null differ diff --git a/locales/bin/main_en.qm b/locales/bin/main_en.qm deleted file mode 100644 index 8a9ba24..0000000 Binary files a/locales/bin/main_en.qm and /dev/null differ diff --git a/rwa-support-desktopapp.pro b/rwa-support-desktopapp.pro index be6011e..f9a05bf 100644 --- a/rwa-support-desktopapp.pro +++ b/rwa-support-desktopapp.pro @@ -41,7 +41,8 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 +# disables all the APIs deprecated before Qt 6.0.0 SOURCES += src/main.cpp \ src/main_qmladaptor.cpp \ diff --git a/src/main.cpp b/src/main.cpp index 9436a2b..ff5d2a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -72,8 +72,9 @@ int main(int argc, char *argv[]) { QQuickStyle::setStyle("Material"); QTranslator translator; - qDebug().noquote() << QString("Locales: Loading locale: qrc:/locales/bin/%0").arg(QLocale::system().name()); - if(translator.load(":/locales/bin/" + QLocale::system().name())) { + qDebug().noquote() << QString("Locales: Loading locale: qrc:/locales/%0") + .arg(QLocale::system().name()); + if(translator.load(":/locales/" + QLocale::system().name())) { app.installTranslator(&translator); qDebug().noquote() << "Locales: Loaded: " + QLocale::system().name() + " locale!"; } else { diff --git a/update_locales.sh b/update_locales.sh index 4884cb6..8c05ece 100755 --- a/update_locales.sh +++ b/update_locales.sh @@ -24,7 +24,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -lupdate . -ts locales/*.ts +lupdate rwa-support-desktopapp.pro -no-obsolete linguist locales/*.ts -lrelease locales/de_DE.ts -qm locales/bin/de_DE.qm -lrelease locales/es_ES.ts -qm locales/bin/es_ES.qm +lrelease rwa-support-desktopapp.pro -compress -removeidentical -- cgit v1.2.3