To help with translations, first clone/fork the
zec-qt-wallet repository. In the
res/ folder, you will find a number of
*.ts files which contain the translations. If you don’t find your language listed, please copy the
zec-qt-wallet_template.ts file and use that.
You can open the
*.ts file (which is an XML file) and enter the translated strings manually using your favourite text editor, and enter the translations in the
translation XML tag. It might be more productive to use the Qt Linguist tool, which provides a nice UI that has additional context and easily manages the strings for translations.
Installing and using Qt Linguist¶
You can install the Qt open source distribution from here, and that comes with Qt Linguist. You can launch it by launching
/path/to/Qt5/bin/linguist res/zec_qt_wallet_<language code>.ts.
Windows and Mac builds for standalone Qt Linguist are available here.
Once you have updated the translations in the
*.ts file, please create a pull request for the file. Please remember to “confirm” the translations from the Linguist menu (or remove the “unfinished” tag from XML element, if you are editing manually).
You don’t have to translate all the strings. You can do this incrementally, and ZecWallet will use all available translated strings, else fall back to English.
If you want to test the translations locally, you’ll have to compile ZecWallet. Please see compiling from source instructions.
Save the linguist file, and then, from a command prompt (remember to replace
ln with your language code):
# Compile the translations /path/to/qt5/bin/lrelease res/zec_qt_wallet_<ln>.ts # Add to the Qt5's base translations /path/to/qt5/bin/lconvert -o res/zec_<ln>.qm res/zec_qt_wallet_<ln>.qm /path/to/qt5/translations/qtbase_<ln>.qm # Copy to the res folder mv res/zec_<ln>.qm res/zec_qt_wallet_<ln>.qm
After this, you can launch your compiled ZecWallet with a LANG environment variable to force ZecWallet to use that language.