Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121418

[Regr: 5.x -> 6.x] QTranslator loads zh instead of zh_TW translation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.4.3, 6.6.1
    • Core: Locales (i18n)
    • None
    • Windows 10, MSVC++ 2022.

    Description

      My app has two Chinese translations: Chinese (China) and Chinese (Taiwan). Translation files are named app_zh.qm and app_zh_TW.qm accordingly.

      When I try to load Chinese (Taiwan) translation, Qt 6.x loads Chinese (China) instead. Qt 5.12.12 works fine.

      Code I use:

      QTranslator t;
      t.load(QLocale("zh_TW"), "app", "_", path);

      QTranslator::load succeeds and loads QLocale("zh") translation instead of QLocale("zh_TW").

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kkohne Kai Köhne
              alervd Alexander Dyagilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes