翻訳ファイルの .ts の翻訳方法

翻訳ファイルの .ts は Poedit では開けない.Qt Linguist というものが使えるそうなので Debian だと wheezy-backports 以降に存在する qttools5-dev-tools を導入する.

% sudo apt install qttools5-dev-tools
% /usr/lib/x86_64-linux-gnu/qt5/bin/linguist

20150917_18:09:30-3415 🏛️

20150917_18:09:24-3340 🏛️

翻訳して保存,「ファイル」->「リリース」で .ts から .qm が作られる.これをコピーして対象アプリケーションを起動すると翻訳が反映されるはず.

% sudo cp ./retext_ja.?? /usr/share/retext/locale

<追記>
コマンドラインで変換する場合は qtchooser パッケージに含まれる lrelease が利用できる.

% lrelease ./retext_ja.ts -qm ./retext_ja.qm

若しくは同パッケージの lconvert でもok.これは qm から ts への変換や pot / po / qph / xlf にも対応している.

% lconvert -i retext_ja.ts -o retext_ja2.qm
% lconvert -if qm -i retext_ja.qm -of ts -o retext_ja2.ts

</追記>

One thought to “翻訳ファイルの .ts の翻訳方法”

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.