示例
以下示例说明了如何准备 Qt 应用程序以进行翻译:
- Hello tr()是一个 C++ 应用程序,演示了如何创建QTranslator 对象。它还展示了
tr()
函数的最简单用法,该函数用于标记用户可见的源文本,以便翻译。 - Arrow Pad是一个 C++ 应用程序,演示了如何使应用程序根据当前的本地语言加载翻译。它还展示了
tr()
的双参数形式的使用,该形式可为翻译提供额外信息。 - Troll Print是一个 C++ 应用程序,演示了如何在同一上下文中区分相同的源文本。它还展示了如何在应用程序升级时尽量减少翻译工作。
- Qt Quick I18N演示了如何国际化 应用程序。Qt Quick
© 2025 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.