Hush language translations https://hush.is
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

2.9 KiB

Translating Hush SD and SDL on Windows

This document provides a detailed guide on how to translate the Hush wallets SilentDragon (SD) and SilentDragonLite (SDL) to your own language. Please be sure to read the general guidelines on https://git.hush.is/hush/translations first.

Software

Even though translation (.ts) files are in plain XML format and can be edited with any text editor, there is a handy tool that not only makes it easier to translate, but also keeps your translation up to date with the source files. For this purpose Qt has provided Linguist and a set of other helper tools to manage and compile your translation. See https://doc.qt.io/qt-5/qtlinguist-index.html for further information on how to use Linguist.

Get Windows compiles of the required files at https://github.com/thurask/Qt-Linguist/releases

In this guide we'll only use linquist.exe and lupdate.exe. Be sure to select the 5.x files for maximum compatibility with Hush.

Getting ready

As we want the translation to be based on the most recent version of the wallets, we're going to download the latest source files first. This example is for SD, but the same applies to SDL. Depending on which wallet you want to translate, go to https://git.hush.is/hush/SilentDragon or https://git.hush.is/hush/SilentDragonLite, make sure that the master branch is selected and in the upper right corner click the "Download Repository" button. Save the source code as a .zip file to your computer. Unpack the zip file to an easy to reach location. For this tutorial we'll use D:/Hush/silentdragon.

Creating or updating a translation

Now with the source files downloaded it's time to create or update a translation based on the latest source files, the process is the same. Here's an example of a command to create a new translation or update an existing translation. For existing translation files, it also removes obsolete translations not present in the current source code:

lupdate.exe "D:\Hush\silentdragon\" -ts "D:\Hush\silentdragon\res\silentdragon_xx.ts" -noobsolete

Let's break down the command:

  • lupdate.exe in this example is assumed to be executed from the path it resides in
  • "D:\Hush\silentdragon\" the path of the source code
  • -ts "D:\Hush\silentdragon\res\silentdragon_xx.ts" the output fle containing the translation with xx being a lower case ISO 639-1 (2-letter) language code. When not available, an ISO 639-2 (3-letter) code can be used.
  • -noobsolete removes the obsolete translations of sections no longer present in the current source code

Editing the .ts file

Start linquist.exe and begin translating the texts and labels. Read the Linguist documentation mentioned above to learn how to use the helper functions to help you with producing clean and consistent translations. When done save your .ts file and publish with File > Release or File > Release As... as a .qm file.