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

qt_add_translations: CFBundleLocalizations might not be added to Info.plist

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • 6.5.0
    • Build System: CMake
    • None
    • iOS/tvOS/watchOS, macOS
    • fe182c154 (dev)

    Description

      https://codereview.qt-project.org/c/qt/qtbase/+/473581 added functionality to add known translations to CFBundleLocalizations in Info.plist. It is supposed to work like this:

      • qt_add_translations(foo TS_FILES ...) reads the languages from the .ts files
      • qt_add_translations sets the property _qt_apple_supported_languages on foo
      • foo's target finalizer reads _qt_apple_supported_languages and adds the information to the Info.plist content

      This is broken in the following project setup:

      # CMakeLists.txt
      cmake_minimum_required(VERSION 3.16)
      project(throwaway)
      set(CMAKE_CXX_STANDARD 20)
      find_package(Qt6 COMPONENTS Core LinguistTools)
      qt_standard_project_setup()
      add_subdirectory(subdir)
      qt_add_translations(foo TS_FILES foo_de.ts)
      
      # subdir/CMakeLists.txt
      qt_add_executable(foo
          main.cpp)
      

      foo's target finalizer runs before qt_add_translations sets the property, and CFBundleLocalizations is not added to Info.plist.

      Attachments

        For Gerrit Dashboard: QTBUG-116716
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            jbornema Joerg Bornemann
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes