Create Qt translation files

Design applications so that they can be adapted to various languages and regions without engineering changes. Mark UI text as translatable to 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. Go to 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 Save as, enter a filename for the translation file.
  4. Go to 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 go to lupdate. It finds translatable strings in source, header, and UI files and generates or updates TS files.

After translating the UI text, go to 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.

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