Skip to content

Translating

GitHub Actions edited this page Oct 10, 2024 · 119 revisions

Translating

Thank you for making translation contributions to ReplayBook! Any help - including partial translations - is appreciated!

Language Missing lines Contributor(s)
Chinese Simplified - 简体中文 28 "ASTWY", "awter", "JerryLiew", "RichardNewb1e", "magcicada"
Chinese Traditional - 繁體中文 28 "N/A", "RichardNewb1e"
French - Français 1 "grog12", "Nokatir", "gzordrai"
German - Deutsch 65 "FlorianHugCH", "xXLaokoonXx"
Portuguese - Português 31 "feikname", "TroniPM"
Russian - русский 6 "xnorxnorxnorxnor"
Spanish - Español 106 "Catinaxo"
Turkish - Türkçe 28 "electrogu"

Table lasted updated: 2024-10-10T21:00:37.436823Z

See the status of translations on the Translation Status page.

Getting started

Create your fork of this repository by pressing the Fork button on the top of the repository page. This will create a copy of everything for you to edit.

All the text displayed by ReplayBook is contained in one strings file: ReplayBook/src/Rofl.UI.Main/Resources/Strings/en.xaml. The file is in XML format, so the text that would need to be translated is between the two tags.

For example, here is how it would look translating a single value:

<string:String x:Key="KeyValue">Hello World!</string:String>
<string:String x:Key="KeyValue">你好世界</string:String>

It is important to keep the x:Key value untouched as ReplayBook uses that to find the text value. There also might be special characters in the strings, if you come across one, just translate around that character. Special characters in strings are usually used for string replacement in the program.

I recommend you create a copy of the strings file and add the language you are translating to the filename. e.g: en.xml -> zh_Hans.xml. Take a look at these language codes to use in the filename.

Using the compare-strings tool

The compare-strings tool makes it easy to see which strings are missing in a language. It works on the principle that if a string is not translated in a language, it will exist in en.xml but not language-you-are-translating.xml.

To run the tool, you need Python installed on the system.

Open a new CMD or PowerShell window and change directory to the 'scripts' folder:

python "compare-strings.py" `
    ..\Rofl.UI.Main\Resources\Strings `
    ..\Rofl.UI.Main\Resources\Strings\en.xaml

By default the tool returns a summary which contains the each translation status as a fraction. You can request different formats using the -format argument. To get a JSON object of all missing values, use -format json like this:

python "compare-strings.py" `
    -format json
    ..\Rofl.UI.Main\Resources\Strings `
    ..\Rofl.UI.Main\Resources\Strings\en.xaml

To get a complete table of all values, use the -format csv option:

python "compare-strings.py" `
    -format csv
    ..\Rofl.UI.Main\Resources\Strings `
    ..\Rofl.UI.Main\Resources\Strings\en.xaml

Pushing your contribution

Once you are finished with your contribution and have committed it into your fork on GitHub. Be sure to delete any keys that were not translated, as that makes future translating easier. Create a new Pull Request to request to have your contribution added to ReplayBook.

Clone this wiki locally