diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2019-07-17 15:14:42 +0200 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2019-07-17 15:14:42 +0200 |
| commit | 05f825a1959653728acc38a844b41ec8b1622374 (patch) | |
| tree | 264ebe54e977337d0faf0a093a117eb2665b14ac /main.cpp | |
| parent | 77521f03e135e9b6c1f6732d749db6b541c8dfac (diff) | |
| parent | 3d67be3023bf34eac7f93fa422f5ef569abb92a9 (diff) | |
Update upstream source from tag 'upstream/2.1.0+repack'
Update to upstream version '2.1.0+repack'
with Debian dir f1034457a9a3db00e6d9c4d0a89a0de3d3134010
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -10,6 +10,7 @@ #include <QTemporaryFile> #include <QDateTime> #include <QApplication> +#include <QTranslator> #include <QRegularExpression> #include <QObject> #include <QSettings> @@ -106,6 +107,34 @@ int main(int argc, char *argv[]) ExceptionCatchingApplication a(argc, argv); try { + // + // Enable i18n + // + QTranslator translator_from_resources; + // Default translations for releases use translations stored in + // the resources file system under the Translations + // directory. These are built by the CMake build system from .ts + // files in the translations source directory. New languages are + // added by enabling the UPDATE_TRANSLATIONS CMake option and + // building with the new language added to the LANGUAGES CMake + // list variable. UPDATE_TRANSLATIONS will preserve existing + // translations but should only be set when adding new + // languages. The resulting .ts files should be checked info + // source control for translators to access and update. + translator_from_resources.load (QLocale::system (), "wsjtx", "_", ":/Translations"); + a.installTranslator (&translator_from_resources); + + QTranslator translator_from_files; + // Load any matching translation from the current directory + // using the locale name. This allows translators to easily test + // their translations by releasing (lrelease) a .qm file into + // the current directory with a suitable name + // (e.g. wsjtx_en_GB.qm), then running wsjtx to view the + // results. Either the system locale setting or the environment + // variable LANG can be used to select the target language. + translator_from_files.load (QString {"wsjtx_"} + QLocale::system ().name ()); + a.installTranslator (&translator_from_files); + setlocale (LC_NUMERIC, "C"); // ensure number forms are in // consistent format, do this after // instantiating QApplication so |
