En esta página

QT_DEPLOY_TRANSLATIONS_DIR

Subdirectorio relativo al prefijo para desplegar las traducciones de Qt en algunas plataformas de destino.

Esta variable es definida por el script nombrado por QT_DEPLOY_SUPPORT. Sólo debe utilizarse como parte del despliegue durante la instalación o una regla post-construcción.

Nota: Esta es una variable API de despliegue de bajo nivel, y sólo debe utilizarse en casos de uso avanzado que no están cubiertos por los comandos API de alto nivel, como qt_generate_deploy_app_script.

Esta variable se introdujo en Qt 6.5.

Los proyectos deberían utilizar QT_DEPLOY_TRANSLATIONS_DIR en sus scripts de despliegue para evitar la codificación de un directorio concreto en el que desplegar las traducciones.

QT_DEPLOY_TRANSLATIONS_DIR El valor por defecto es translations. Para cambiar el valor de QT_DEPLOY_TRANSLATIONS_DIR, ajústelo en el script de despliegue del proyecto antes de incluir QT_DEPLOY_SUPPORT.

La ruta QT_DEPLOY_TRANSLATIONS_DIR es relativa a QT_DEPLOY_PREFIX.

Esta variable no es significativa cuando se despliega en macOS o Windows.

Ejemplo

cmake_minimum_required(VERSION 3.16...3.22)
project(MyThings)

# The following CMAKE_INSTALL_*DIR variables are used to initialize their
# QT_DEPLOY_*_DIR counterparts.
set(CMAKE_INSTALL_BINDIR "mybindir")
set(CMAKE_INSTALL_LIBDIR "mylibdir")
set(CMAKE_INSTALL_LIBEXECDIR "mylibexecdir")

find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()

qt_add_executable(MyApp main.cpp)

set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_MyApp.cmake")
file(GENERATE OUTPUT ${deploy_script} CONTENT "

set(QT_DEPLOY_PLUGINS_DIR \"mypluginsdir\")
set(QT_DEPLOY_TRANSLATIONS_DIR \"i18n\")

include(\"${QT_DEPLOY_SUPPORT}\")

qt_deploy_runtime_dependencies(
    EXECUTABLE \"\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:MyApp>\"
)")

install(SCRIPT ${deploy_script})

Ver también QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR, QT_DEPLOY_LIBEXEC_DIR, QT_DEPLOY_PLUGINS_DIR y QT_DEPLOY_QML_DIR.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.