diff --git a/src/widget/translator.cpp b/src/widget/translator.cpp index 78c8719b3..e320e38b8 100644 --- a/src/widget/translator.cpp +++ b/src/widget/translator.cpp @@ -53,25 +53,23 @@ void Translator::translate(const QString& localeName) // Load translations QString locale = localeName.isEmpty() ? QLocale::system().name().section('_', 0, 0) : localeName; - if (locale != "en") { - if (core_translator->load(locale, ":translations/")) { - qDebug() << "Loaded translation" << locale; + if (core_translator->load(locale, ":translations/")) { + qDebug() << "Loaded translation" << locale; - // System menu translation - QString s_locale = "qt_" + locale; - QString location = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - if (app_translator->load(s_locale, location)) { - QApplication::installTranslator(app_translator); - qDebug() << "System translation loaded" << locale; - } else { - qDebug() << "System translation not loaded" << locale; - } - - // Application translation - QCoreApplication::installTranslator(core_translator); + // System menu translation + QString s_locale = "qt_" + locale; + QString location = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + if (app_translator->load(s_locale, location)) { + QApplication::installTranslator(app_translator); + qDebug() << "System translation loaded" << locale; } else { - qDebug() << "Error loading translation" << locale; + qDebug() << "System translation not loaded" << locale; } + + // Application translation + QCoreApplication::installTranslator(core_translator); + } else { + qDebug() << "Error loading translation" << locale; } // After the language is changed from RTL to LTR, the layout direction isn't diff --git a/tools/update-translation-files.sh b/tools/update-translation-files.sh index d23fa9614..71d0d6f88 100755 --- a/tools/update-translation-files.sh +++ b/tools/update-translation-files.sh @@ -27,14 +27,15 @@ set -eu -o pipefail -readonly LUPDATE_CMD="lupdate src -no-obsolete -locations none -ts" +readonly LUPDATE_CMD="lupdate src -no-obsolete -locations none" if [[ "$@" = "ALL" ]] then for translation in translations/*.ts do - $LUPDATE_CMD "$translation" + $LUPDATE_CMD -ts "$translation" done + $LUPDATE_CMD -pluralonly -ts translations/en.ts else $LUPDATE_CMD "$@" fi diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt index 1d5f2ab77..99ba435cc 100644 --- a/translations/CMakeLists.txt +++ b/translations/CMakeLists.txt @@ -24,6 +24,7 @@ qt5_add_translation(translations_FILES da.ts de.ts el.ts + en.ts eo.ts es.ts et.ts diff --git a/translations/README.md b/translations/README.md index 50c6f35cf..70e4cf5ed 100644 --- a/translations/README.md +++ b/translations/README.md @@ -16,6 +16,7 @@ Language | Status [Deutsch](https://hosted.weblate.org/engage/tox/de/) | [![Translation status](https://hosted.weblate.org/widgets/tox/de/svg-badge.svg)](https://hosted.weblate.org/engage/tox/de/?utm_source=widget) [Eesti](https://hosted.weblate.org/engage/tox/et/) | [![Translation status](https://hosted.weblate.org/widgets/tox/et/svg-badge.svg)](https://hosted.weblate.org/engage/tox/et/?utm_source=widget) [Ελληνικά](https://hosted.weblate.org/engage/tox/el/) | [![Translation status](https://hosted.weblate.org/widgets/tox/el/svg-badge.svg)](https://hosted.weblate.org/engage/tox/el/?utm_source=widget) +[English](https://hosted.weblate.org/engage/tox/en/) | [![Translation status](https://hosted.weblate.org/widgets/tox/en/svg-badge.svg)](https://hosted.weblate.org/engage/tox/en/?utm_source=widget) [Español](https://hosted.weblate.org/engage/tox/es/) | [![Translation status](https://hosted.weblate.org/widgets/tox/es/svg-badge.svg)](https://hosted.weblate.org/engage/tox/es/?utm_source=widget) [Esperanto](https://hosted.weblate.org/engage/tox/eo/) | [![Translation status](https://hosted.weblate.org/widgets/tox/eo/svg-badge.svg)](https://hosted.weblate.org/engage/tox/eo/?utm_source=widget) [فارسی](https://hosted.weblate.org/engage/tox/fa/) | [![Translation status](https://hosted.weblate.org/widgets/tox/fa/svg-badge.svg)](https://hosted.weblate.org/engage/tox/fa/?utm_source=widget) diff --git a/translations/en.ts b/translations/en.ts new file mode 100644 index 000000000..0502e1acd --- /dev/null +++ b/translations/en.ts @@ -0,0 +1,57 @@ + + + + + AddFriendForm + + Ready to import %n contact(s), click send to confirm + + + + + + + GroupChatForm + + %n user(s) in chat + Number of users in chat + + + + + + + GroupWidget + + %n user(s) in chat + Number of users in chat + + + + + + + NotificationEdgeWidget + + Unread message(s) + + + + + + + Widget + + %n new friend request(s) + + + + + + %n new group invite(s) + + + + + + diff --git a/translations/i18n.pri b/translations/i18n.pri index 2433ef9fd..dde1ba1eb 100644 --- a/translations/i18n.pri +++ b/translations/i18n.pri @@ -9,6 +9,7 @@ TRANSLATIONS = \ translations/da.ts \ translations/de.ts \ translations/el.ts \ + translations/en.ts \ translations/eo.ts \ translations/es.ts \ translations/et.ts \ diff --git a/translations/translations.qrc b/translations/translations.qrc index ef6e91d78..1edd220ef 100644 --- a/translations/translations.qrc +++ b/translations/translations.qrc @@ -8,6 +8,7 @@ da.qm de.qm el.qm + en.qm eo.qm es.qm et.qm