在本页中

更新 Qt 翻译文件

要更新项目的所有 TS 或 QM 文件,请转到Qt >lupdate All .ts Files for Project 或lrelease All .ts Files for Project 。

在构建过程中运行翻译工具

在构建项目时运行lupdate或lrelease:

  1. 在Solution Explorer 中,右键单击项目,然后在上下文菜单中选择Qt >Qt Project Settings 。
  2. 选择Configuration Properties >Qt Translation >General 。
  3. 在Run Translation Tool During Build 中,选择要运行的工具。

    Qt 翻译属性

注意: 只有当项目有翻译文件时,才会显示Qt Translation 属性。

设置 lupdate 属性

为项目设置运行lupdate 的属性:

  1. 在Solution Explorer 中,右键单击项目,然后在上下文菜单中选择Qt >Qt Project Settings 。
  2. 选择Configuration Properties >Qt Translation >lupdate 。

    lupdate 属性

  3. 选择一个属性,查看其描述。

有关可在AdditionalOptions 中设置的属性列表,请参阅lupdate 选项。

设置 lrelease 属性

要为一个项目设置运行lrelease 的属性:

  1. 在Solution Explorer 中,右键单击项目,然后在上下文菜单中选择Qt >Qt Project Settings 。
  2. 选择Configuration Properties >Qt Translation >lrelease 。

    释放特性

  3. 选择一个属性,查看其描述。

有关可在AdditionalOptions 中设置的属性列表,请参阅lrelease 选项。

另请参阅 创建 Qt 翻译文件、启动Qt Linguist 、Qt 的国际化和Qt Linguist 手册。

© 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.