Create Qt translation files

You can design applications so that they can be adapted to various languages and regions without engineering changes. If you mark UI text as translatable, you can create Qt translation source (TS) files that contain them and start Qt Linguist to translate the strings.

To add a new translation file to the project:

  1. Select Project > Add New Item > Installed > Visual C++ > Qt > Qt Translation File.
  2. In Select a Language, select a language from the list of supported languages. Use Search to filter for a specific language.

  3. In the Save as field, enter a filename for the translation file.
  4. Select Finish to create the file and have it listed in Translation Files in Visual Studio's Solution Explorer.
  5. Right-click the translation file to open a context menu, and select lupdate. It finds translatable strings in source, header, and UI files and generates or updates TS files.

After translating the UI text, select lrelease in the context menu to create QM files out of TS files. The QM file format is a compact binary format that the localized application uses to look up translations.

See also Start Qt Linguist, Update Qt translation files, Internationalization with Qt, and Qt Linguist Manual.

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