diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-08-30 15:55:27 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-08-31 16:43:06 +0200 |
commit | b42a5bac54a9d6781691af9e796ef0c4c3514fce (patch) | |
tree | 3a1f0304e3aaa413134dc22a975402c5b4ee2716 /doc | |
parent | 76a0f6cab2df2afa2e68c9f6d35fbbb27afcdc39 (diff) |
Update documentation on translations
Adapt to qtbase/74515a7a30b809a3ab0a2d67496e870ea3c872e6.
Pick-to: 6.2
Change-Id: I200e8a6803a46deb064f84d312a15e888f5d4e6d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/src/internationalization/i18n.qdoc | 30 | ||||
-rw-r--r-- | doc/src/snippets/code/doc_src_i18n.cpp | 10 |
2 files changed, 21 insertions, 19 deletions
diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index 45fc623ec..777bb863e 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -227,49 +227,49 @@ \li Catalog \row \li \l [QtConcurrent]{Qt Concurrent} - \li \c qtbase_ + \li \c qtbase \row \li \l [QtCore]{Qt Core} - \li \c qtbase_ + \li \c qtbase \row \li \l [QtDBus]{Qt D-Bus} - \li \c qtbase_ + \li \c qtbase \row \li \l {Qt Designer} - \li \c designer_ + \li \c designer \row \li \l [QtGui]{Qt GUI} - \li \c qtbase_ + \li \c qtbase \row \li \l {Qt Help} - \li \c qt_help_ + \li \c qt_help \row \li \l {Qt Linguist Manual}{Qt Linguist} - \li \c linguist_ + \li \c linguist \row \li \l[Qt Network]{Qt Network} - \li \c qtbase_ + \li \c qtbase \row \li \l [QtPrintSupport]{Qt Print Support} - \li \c qtbase_ + \li \c qtbase \row \li \l {Qt QML} - \li \c qtdeclarative_ + \li \c qtdeclarative \row \li \l {Qt Quick} - \li \c qtdeclarative_ + \li \c qtdeclarative \row \li \l {Qt Quick Controls} - \li \c qtquickcontrols2_ + \li \c qtdeclarative \row \li \l {Qt Quick Widgets C++ Classes}{Qt Quick Widgets} - \li \c qtdeclarative_ + \li \c qtdeclarative \row \li \l [QtSql]{Qt SQL} - \li \c qtbase_ + \li \c qtbase \row \li \l [QtWidgets]{Qt Widgets} - \li \c qtbase_ + \li \c qtbase \endtable \section2 Example: Basic Qt Modules diff --git a/doc/src/snippets/code/doc_src_i18n.cpp b/doc/src/snippets/code/doc_src_i18n.cpp index 2bd80d5ab..c5f379b97 100644 --- a/doc/src/snippets/code/doc_src_i18n.cpp +++ b/doc/src/snippets/code/doc_src_i18n.cpp @@ -130,8 +130,8 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); QTranslator myappTranslator; - myappTranslator.load(QLocale(), QLatin1String("myapp"), QLatin1String("_"), QLatin1String(":/i18n")); - app.installTranslator(&myappTranslator); + if (myappTranslator.load(QLocale::system(), u"myapp"_qs, u"_"_qs, u":/i18n"_qs)) + app.installTranslator(&myappTranslator); return app.exec(); } @@ -197,6 +197,8 @@ void same_global_function(LoginWidget *logwid) //! [14] QTranslator qtTranslator; - qtTranslator.load(QLocale::system(), QStringLiteral("qtbase_")); - app.installTranslator(&qtTranslator); + if (qtTranslator.load(QLocale::system(), u"qtbase"_qs, u"_"_qs, + QLibraryInfo::path(QLibraryInfo::TranslationsPath))) { + app.installTranslator(&qtTranslator); + } //! [14] |