Skip to content

Translation

HLXEasy edited this page Feb 23, 2021 · 1 revision

Help translating Alias to different languages

Translate to different language

If you like to contribute, head over to Transifex, create an account and apply for the work on Alias translations.

Specialties:

Placeholders

There are a lot of strings in the form Hello %s. That means, that %s will be replaced with a given value like a name. During the translation these placeholders needs to stay intact. Additionally the order of the placeholders must be the same, if there are multiple ones!

Plural

If the source string is something like I have %d donut(s), there should be multiple results on the translation. If it's filled, the first form would be I have 1 donut and as soon as the number increases, it changes to I have 2 donuts. Transifex knows the specialties for these things on different languages. Like to dive deeper into this? See here.

Tips & Tricks

To switch to the next entry to translate, just press tab key on your keyboard. 😉

Technical background

To make it easier to understand the background, here's a very simplified explanation, how the translation technically works. Don't worry, you don't need to fiddle around with the tech stuff!

To show a string on the user interface (UI), it is used i. e. this way:

String message = tr("Hello world!")

So the function tr(...) translates the given string Hello world! onto the currently used language. That's in simple words what happens under the hood.

Now to the translation process itself. During the build of the binaries, a separate file for the master language is generated: alias_en.ts. This file contains all strings found on the code, wrapped on an xml structure and will be uploaded to transifex. The translation process there generates separate files for each translated language, which needs to be downloaded to update the already existing translation files. The next build of the binaries will use these updated translation.