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

qt_add_translations problems with PLURAL_TS_FILES

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.8.0
    • Build System: CMake
    • None
    • All

    Description

      My CMakeLists.txt says:

      qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES ca cs de es fr it ja_JP nl pt_BR ro ru tr zh_CN zh_TW)
      qt_add_translations(${PROJECT_NAME} TS_FILE_DIR i18n PLURALS_TS_FILE ${PROJECT_NAME}_en PLURALS_TS_FILE ${PROJECT_NAME}_en_GB )

      but when I try to use either the en or the en_GB language files they fail to load, but the other languages work:

      Loading translator file [ "qt_fr" ] from path: "/opt/Qt/6.8.0/gcc_64/translations"
      Loading translator file [ "DeepSkyStacker_fr" ] from path: ":/i18n/"
      Loading translator file [ "DeepSkyStackerKernel_fr" ] from path: ":/i18n/"
      Loading translator file [ "qt_en_GB" ] from path: "/opt/Qt/6.8.0/gcc_64/translations" 
      Failed to install translator for file [ "qt_en_GB" ]
      Loading translator file [ "DeepSkyStacker_en_GB" ] from path: ":/i18n/"
      Failed to install translator for file [ "DeepSkyStacker_en_GB" ]
      Loading translator file [ "DeepSkyStackerKernel_en_GB" ] from path: ":/i18n/"
      

      The generated .qrc file has the _en and _en_GB files at the end rather than in alphabetic order:

      <RCC>
      <qresource prefix="/i18n">
      <file alias="DeepSkyStacker_ca.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_ca.qm</file>
      <file alias="DeepSkyStacker_cs.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_cs.qm</file>
      <file alias="DeepSkyStacker_de.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_de.qm</file>
      <file alias="DeepSkyStacker_es.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_es.qm</file>
      <file alias="DeepSkyStacker_fr.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_fr.qm</file>
      <file alias="DeepSkyStacker_it.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_it.qm</file>
      <file alias="DeepSkyStacker_ja_JP.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_ja_JP.qm</file>
      <file alias="DeepSkyStacker_nl.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_nl.qm</file>
      <file alias="DeepSkyStacker_pt_BR.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_pt_BR.qm</file>
      <file alias="DeepSkyStacker_ro.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_ro.qm</file>
      <file alias="DeepSkyStacker_ru.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_ru.qm</file>
      <file alias="DeepSkyStacker_tr.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_tr.qm</file>
      <file alias="DeepSkyStacker_zh_CN.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_zh_CN.qm</file>
      <file alias="DeepSkyStacker_zh_TW.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_zh_TW.qm</file>
      <file alias="DeepSkyStacker_en.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_en.qm</file>
      <file alias="DeepSkyStacker_en_GB.qm">/home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker_en_GB.qm</file>
      </qresource>
      </RCC>

      could that explain the problem?

      PS FWIW why should I have to specify (e.g.)

       ${PROJECT_NAME}_en
      

      for qt_add_translations while qt_standard_project_setup just uses the language name and prepends

      ${PROJECT_NAME}_
      

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              perdrix David Partridge
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes