Translations.wiki
author Wuzzy
Thu, 10 Sep 2015 02:03:47 +0000
changeset 629 d4ccc5e79e58
parent 592 2a5ecd20bf16
child 669 a9110bd62394
permissions -rw-r--r--
fix link?
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     1
#summary This is a guide for new translators.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     2
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     3
= Introduction =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     4
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     5
This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     6
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     7
 # The latest Hedgewars localization files
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
     8
 # A text editor like Notepad++, Geany, Vim, etc.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     9
 # Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    10
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    11
= Getting the localization files =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    12
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    13
To get the Hedgewars localization files there are 4 possible ways.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    14
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    15
 * *A*. Clone the Hedgewars source repository.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    16
 * *B*. Download the latest Hedgewars source code.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    17
 * *C*. Find the localization files in your current Hedgewars installation.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    18
 * *D*. Download only the specific files to be translated.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    19
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    20
The *A* is maybe the most convenient way to include the translations in the next Hedgewars release as you can easily produce a patch to provide it to the Hedgewars developers. Note that a fast internet connection is desired as you probably will clone the whole game sources. The other advantage of this way is that it can be used to translate the latest game version that is going to be released.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    21
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    22
The *B* way is a lot like the *A* way but more limited.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    23
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    24
The *C* is probably the fastest way and the more convenient for the translator.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    25
However, it has the limitation that one can only translate the most recent Hedgewars release (the one currently installed) and not the version that is going to be released.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    26
592
2a5ecd20bf16 update some link URLs
sheepluva
parents: 571
diff changeset
    27
The *D* way is to download the desired files from [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Locale/ here].
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    28
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    29
Above I am going to discuss the *C* way (Find the localization files in your current Hedgewars installation).
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    30
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    31
== Finding the localization files ==
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    32
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    33
In GNU/Linux you have to look into `/path-to-Hedgewars/Data/Locale where path-to-Hedgewars` is the path to your Hedgewars installation.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    34
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    35
In Windows you have to look into `c:\path-to-Hedgewars\share\Hedgewars\Data\Locale` where path-to-Hedgewars is the path to your Hedgewars installation.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    36
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    37
For example in an Arch Linux box the path is `/usr/share/Hedgewars/Data/Locale`.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    38
In a Windows 8 box the path is `C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale`.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    39
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    40
= Translation Files =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    41
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    42
I am going to list the different localization files of the English language that you should use as your translation reference/template as it should be the most accurate and up to date.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    43
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    44
 * `en.txt`—This is the engine's strings
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    45
 * `hedgewars_en.ts`—This is the front-end's strings and you can edit it with Qt Linguist
571
76d662d04947 Wiki link to [Missions].
almikes@aol.com
parents: 496
diff changeset
    46
 * `missions_en.txt`—This is the [Missions mission] description strings
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    47
 * `campaigns_en.txt`—This is the campaign description strings
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    48
 * `stub.lua`—This is all the Lua files (Missions, maps etc.) strings
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    49
 * `tips_en.xml`—This contains the tips shown in the main menu. This file is *not* in XML format!
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    50
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    51
= Updating an existing translation =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    52
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    53
That is relatively easy. Just edit the existing file. You can edit every file with your favorite editor and the `.ts` file with Qt Linguist.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    54
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    55
The `en.lua` file doesn’t exist. The strings are hard coded in the code.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    56
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    57
= Creating a new translation =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    58
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    59
That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
368
2982cf17f347 Edited wiki page Translations through web user interface. Mention stub.lua
pntanasis@gmail.com
parents: 367
diff changeset
    60
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    61
The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
368
2982cf17f347 Edited wiki page Translations through web user interface. Mention stub.lua
pntanasis@gmail.com
parents: 367
diff changeset
    62
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    63
Here are 3 examples:
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    64
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    65
 * For French copy `en.txt` to `fr.txt`
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    66
 * For Spanish copy `en.txt` to `es.txt`
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    67
 * For Greek copy `en.txt` to `el.txt`
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    68
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    69
= Testing the translations =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    70
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    71
When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    72
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    73
If a translation is missing then the string is going to be displayed in English.
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    74
Note that you should restart the frondend for the language changes to take effect.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    75
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    76
= Sharing the translations =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    77
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    78
In order to share your translations with Hedgewars community there are 3 possible ways:
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    79
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    80
 # Give them the files and tell them where to place them. Of course this is the less convenient way but it is maybe a good approach to let other players double check your translations.
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    81
 # Talk with a Hedgewars developer in order to include it in DLC (http://Hedgewars.org/content.html)
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    82
 # Talk with a Hedgewars developer in order to include it in the next Hedgewars release.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    83
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    84
= Things to have in mind =
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    85
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    86
If you are going to make a translation for a next Hedgewars release strings may not be frozen yet and change before the release. Better ask in irc in cases like that.