Qt 翻訳ファイルの作成

エンジニアリングを変更することなく、さまざまな言語や地域に対応できるようにアプリケーションを設計します。UI テキストを翻訳可能なものとしてマークして、それを含む Qt 翻訳ソース(TS)ファイルを作成し、Qt Linguist を起動して文字列を翻訳します。

プロジェクトに新しい翻訳ファイルを追加するには:

  1. Project >Add New Item >Installed >Visual C++ >Qt >Qt Translation File に移動します。
  2. Select a Language で、サポートされている言語のリストから言語を選択します。Search を使用して、特定の言語を絞り込みます。

    プロジェクトに翻訳ファイルを追加する

  3. Save as で、翻訳ファイルのファイル名を入力します。
  4. Finish にアクセスしてファイルを作成し、Visual Studio のSolution Explorer のTranslation Files に表示されるようにします。
  5. 翻訳ファイルを右クリックしてコンテキスト・メニューを開き、lupdate 。 ソース、ヘッダー、および UI ファイルで翻訳可能な文字列を検索し、TS ファイルを生成または更新します。

UIテキストを翻訳した後、コンテキストメニューのlrelease 、TSファイルからQMファイルを作成します。QMファイルフォーマットは、ローカライズされたアプリケーションが翻訳を検索するために使用するコンパクトなバイナリフォーマットです。

StartQt Linguist 、Update Qt translation files、Internationalization with Qt、Qt Linguist Manualも参照してください 。

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