Translations.wiki
author sheepluva
Thu, 23 Mar 2023 20:47:32 +0000
changeset 2221 4bf8172a73a1
parent 2203 9e15e7766b70
permissions -rw-r--r--
TableOfContents: TableOfContents: Adjust two Entries
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
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
     3
= Translations =
2200
b285ffef13e0 Translations: Add TOC
Wuzzy
parents: 2199
diff changeset
     4
<wiki:toc max_depth="2" />
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
     5
== Introduction ==
365
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
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
     8
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
     9
 # 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
    10
 # A text editor like Notepad++, Geany, Vim, etc.
1872
5d381521e757 Translations: clarify Linguist
Wuzzy
parents: 1614
diff changeset
    11
 # Qt Linguist (not strictly required but strongly recommended). To download Qt Linguist, you have to download the Qt SDK.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    12
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
    13
== Getting the localization files ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    14
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    15
To get the Hedgewars localization files there are 4 possible ways.
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    16
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    17
 * *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
    18
 * *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
    19
 * *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
    20
 * *D*. Download only the specific files to be translated.
365
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 *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
    23
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    24
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
    25
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    26
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
    27
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
    28
1296
885bb08a1fd8 Translations: fix raw-file link
Wuzzy
parents: 1143
diff changeset
    29
The *D* way is to download the desired files from [https://hg.hedgewars.org/hedgewars/file/default/share/hedgewars/Data/Locale/ here].
365
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
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
    32
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
    33
=== Finding the localization files ===
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 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
    36
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
    37
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
    38
1083
7c2227de5b22 Translations: fix Arch Linux path
Wuzzy
parents: 1082
diff changeset
    39
For example, in an Arch Linux box the path is `/usr/share/hedgewars/Data/Locale`.
2049
8e2c42ce20c5 Translations: fix win8 path
Wuzzy
parents: 1872
diff changeset
    40
For Windows 8, the path is `C:\Program Files (x86)\Hedgewars <version>\Data\Locale`.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    41
1088
c9c103205984 Translations: language codes
Wuzzy
parents: 1087
diff changeset
    42
== Language codes ==
c9c103205984 Translations: language codes
Wuzzy
parents: 1087
diff changeset
    43
Languages are identified with the [https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1 language code] (e.g. “de” for German). For regional language variants, an [https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ISO 3166-1 alpha-2 country code] can be appended with an underscore (e.g. “pt_BR” for Brazilian Portuguese).
c9c103205984 Translations: language codes
Wuzzy
parents: 1087
diff changeset
    44
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
    45
== Translation files ==
922
6d9246385399 Translations: Mention text editors
Wuzzy
parents: 921
diff changeset
    46
Here is a list of 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. The file locations are relative to the top directory of the Hedgewars source code. You can edit all these files with a text editor, but for some files special editors are available.
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
    47
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    48
=== Overview ===
1107
f65c76eb2345 Translations: AppData
Wuzzy
parents: 1106
diff changeset
    49
These are all files which contain translatable text for Hedgewars. Replace “ZZ” with the actual language code.
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    50
 * `/share/hedgewars/Data/Locale/ZZ.txt`—In-game strings
1614
7b474acf45f8 Translations: clarify scripted stuff
Wuzzy
parents: 1591
diff changeset
    51
 * `/share/hedgewars/Data/Locale/ZZ.lua`—Scripted stuff (missions and game styles)
1087
2ada7beb1e71 Translations: longer dash
Wuzzy
parents: 1086
diff changeset
    52
 * `/share/hedgewars/Data/Locale/hedgewars_ZZ.ts`—Frontend
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    53
 * `/share/hedgewars/Data/Locale/missions_ZZ.txt`—Mission names and descriptions
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    54
 * `/share/hedgewars/Data/Locale/campaigns_ZZ.txt`—Campaign names and descriptions
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    55
 * `/share/hedgewars/Data/Locale/tips_ZZ.xml`—Main menu tips
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    56
 * `/share/hedgewars/Data/Maps/<map name>/desc.txt`—Mission map descriptions
1107
f65c76eb2345 Translations: AppData
Wuzzy
parents: 1106
diff changeset
    57
f65c76eb2345 Translations: AppData
Wuzzy
parents: 1106
diff changeset
    58
These files are not part of Hedgewars itself, but are used by other programs and websites to present Hedgewars:
f65c76eb2345 Translations: AppData
Wuzzy
parents: 1106
diff changeset
    59
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    60
 * `/share/hedgewars/Data/misc/hedgewars.desktop`—[https://wiki.freedesktop.org/www/Specifications/desktop-entry-spec/ Desktop Entry] file for Hedgewars
1086
3333fe1e418d Translations: fix syntax
Wuzzy
parents: 1085
diff changeset
    61
 * `/share/hedgewars/Data/misc/hwengine.desktop`—*Do not translate!*
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    62
 * `/share/hedgewars/Data/misc/hwengine.desktop.in`—Desktop Entry file for the engine
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    63
 * `/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml`—File type descriptions
1108
befdf6748279 Translations: AppData link
Wuzzy
parents: 1107
diff changeset
    64
 * `/share/hedgewars.appdata.xml`—[https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html AppData] description
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    65
923
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
    66
=== Engine (in-game stuff) ===
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    67
 * `/share/hedgewars/Data/Locale/ZZ.txt`—This contains the core in-game strings, such as the mission panel, the messages at the top, ammo names and descriptions (see below)
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
    68
 * `/share/hedgewars/Data/Locale/ZZ.lua`—Strings used by Lua scripts, which includes campaigns, missions and game styles (see below)
1024
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
    69
1034
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    70
==== `.txt` files ====
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    71
A `.txt` file is organized in lines and string identifiers. Each string is identified with two numbers like `01:05`. The first number is called the “group”.
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    72
1036
02a8ca9acbac Translations: Fix typos
Wuzzy
parents: 1035
diff changeset
    73
Each line must contain a single translation and follows this format:
1034
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    74
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    75
`XX:YY=Translation`
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    76
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    77
For example:
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    78
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    79
`00:00=Grenade`
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    80
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    81
See `en.txt` for the English original texts. Note that some of the numbers may be missing in your file, so you need to add them on your own.
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    82
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    83
The group `02` is special because texts can be repeated here. These texts are used for event messages like the death of a hedgehog (`02:00`). Hedgewars will randomly use any of these messages in the same group. Each language can have its own set of messages for this. Translations can be rather flexible here.
1036
02a8ca9acbac Translations: Fix typos
Wuzzy
parents: 1035
diff changeset
    84
In `02`, you don't need to translate every English message, but try to do your best. It is OK to omit messages if a direct translation wouldn't make sense (e.g. for weird English idioms). You can also invent your messages which are more appropriate for your language. If you're in a hurry, you can just add single a single message for each of the `02` groups (`02:00`, `02:01`, `02:02`, etc.), but don't forget to finish it later.
1034
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    85
1589
109973baaf21 Translations: Update special character info
Wuzzy
parents: 1588
diff changeset
    86
In the `04` and `05` groups, you can use a couple of special characters:
109973baaf21 Translations: Update special character info
Wuzzy
parents: 1588
diff changeset
    87
1590
2ef11bd6751d Translations: simplify symbols
Wuzzy
parents: 1589
diff changeset
    88
 * `|`: Line break
1591
a2986bfc8764 Translations: fix typo
Wuzzy
parents: 1590
diff changeset
    89
 * `:`: Highlight itself and all text before that character in this line. The colon itself will be written.
a2986bfc8764 Translations: fix typo
Wuzzy
parents: 1590
diff changeset
    90
 * `::`: Like above, except the two colons will not be written.
1590
2ef11bd6751d Translations: simplify symbols
Wuzzy
parents: 1589
diff changeset
    91
 * `\:`: Will be replaced with “:” without triggering highlighting (escape sequence)
2ef11bd6751d Translations: simplify symbols
Wuzzy
parents: 1589
diff changeset
    92
 * `\|`: Will be replaced with “|” without triggering a line break (escape sequence)
1034
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    93
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    94
Don't forget to test these texts in-game to make sure everything looks fine.
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    95
f55656ceb224 Translations: Explain the syntax of txt files
Wuzzy
parents: 1024
diff changeset
    96
==== `.lua` files ====
1024
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
    97
In a `.lua` file you will find many lines like this:
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
    98
1587
785d4a78e2a9 Translations: fix code syntax
Wuzzy
parents: 1296
diff changeset
    99
`--        ["Rubber Band"] = "", -- Construction_Mode`
1024
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   100
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   101
Those need to be translated. The part in square brackets is the English original text.
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   102
The part in the quotation marks after the equals sign is supposed to contain the translation.
1081
0d4b50924470 Translations: explain dashes in .lua
Wuzzy
parents: 1052
diff changeset
   103
The initial two dashes and spaces are used for strings which hav not been translated yet. You need to remove them after you've completed the translation.
0d4b50924470 Translations: explain dashes in .lua
Wuzzy
parents: 1052
diff changeset
   104
0d4b50924470 Translations: explain dashes in .lua
Wuzzy
parents: 1052
diff changeset
   105
The two dashes at the end don't need translation, it's just the beginning of a comment for you to show you the source of the English text. In this case, it comes from the Construction Mode script.
1024
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   106
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   107
Example for a translated line (in Italian):
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   108
1587
785d4a78e2a9 Translations: fix code syntax
Wuzzy
parents: 1296
diff changeset
   109
`["Rounds Complete"] = "Round Completati",`
1024
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   110
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   111
In case you need to include a quotation mark in your translation, write `\"` instead of `"`.
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   112
f243d261e679 Translations: Explain .lua files
Wuzzy
parents: 976
diff changeset
   113
Note to programmers: These `.lua` files are actually containing real Lua source code.
923
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   114
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   115
=== Frontend (main menu) ===
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   116
 * `/share/hedgewars/Data/Locale/hedgewars_ZZ.ts`—Contains most strings of the frontend and you can edit it with Qt Linguist
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   117
 * `/share/hedgewars/Data/Locale/missions_ZZ.txt`—This is the [Missions mission] description strings
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   118
 * `/share/hedgewars/Data/Locale/campaigns_ZZ.txt`—This is the campaign description strings
1090
a97043d9df1f Translations: fix typo
Wuzzy
parents: 1089
diff changeset
   119
 * `/share/hedgewars/Data/Locale/tips_ZZ.xml`—This contains the tips shown in the main menu. This file is *not* in XML format.
669
a9110bd62394 Add metadata files
Wuzzy
parents: 592
diff changeset
   120
923
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   121
==== Mission map descriptions ====
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   122
The map selection shows brief descriptions for mission maps below the preview image. Those can be translated and you find those texts in:
883
54d163c108c1 Translations: mention mission map files
Wuzzy
parents: 798
diff changeset
   123
54d163c108c1 Translations: mention mission map files
Wuzzy
parents: 798
diff changeset
   124
 * `/share/hedgewars/Data/Maps/<map name>/desc.txt`
54d163c108c1 Translations: mention mission map files
Wuzzy
parents: 798
diff changeset
   125
1588
a864d2778694 Translations: fix code syntax again
Wuzzy
parents: 1587
diff changeset
   126
Replace “`<map name>`” with the name of any mission map. You see a list of mission maps if you select the map type “mission map” when preparing a game.
975
c725521d6249 Translations: Simplify mission map desc stuff
Wuzzy
parents: 974
diff changeset
   127
1143
e97eb0f00c5e Translations: remove reference to 0.9.23
Wuzzy
parents: 1108
diff changeset
   128
To translate these, add a line of the format `language code=description` (e.g. “en=This is an example.” for English). You must use the following special character sequences for new lines, commas and underscores:
921
8fab0a7c8164 Translations: Documentation of new desc.txt escapes
Wuzzy
parents: 906
diff changeset
   129
8fab0a7c8164 Translations: Documentation of new desc.txt escapes
Wuzzy
parents: 906
diff changeset
   130
|| *Written text* || *Is replaced by* ||
8fab0a7c8164 Translations: Documentation of new desc.txt escapes
Wuzzy
parents: 906
diff changeset
   131
|| `_n` || New line ||
8fab0a7c8164 Translations: Documentation of new desc.txt escapes
Wuzzy
parents: 906
diff changeset
   132
|| `_c` || Comma ||
8fab0a7c8164 Translations: Documentation of new desc.txt escapes
Wuzzy
parents: 906
diff changeset
   133
|| `__` || Underscore ||
883
54d163c108c1 Translations: mention mission map files
Wuzzy
parents: 798
diff changeset
   134
923
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   135
=== Metadata ===
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   136
The following files are not used by Hedgewars itself, but they contain translatable metadata about Hedgewars:
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   137
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   138
 * `/share/hedgewars/Data/misc/hedgewars.desktop`—[https://wiki.freedesktop.org/www/Specifications/desktop-entry-spec/ Desktop Entry] file for the Hedgewars application
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   139
 * `/share/hedgewars/Data/misc/hwengine.desktop.in`—Desktop Entry file for the Hedgewars engine for playing savegames and demos
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   140
 * `/share/hedgewars/Data/misc/hwengine.desktop`—*Do not translate*! This file will be automatically generated from `hwengine.desktop.in` when building Hedgewars
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   141
 * `/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml`—Description of Hedgewars file types
1106
ccd179ba2358 Translations: Add hedgewars.appdata.xml
Wuzzy
parents: 1090
diff changeset
   142
 * `/share/hedgewars.appdata.xml`—[https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html AppData] description (for the desciption in software distribution services)
923
afa2ae557fb3 Translations: Restructure translation files list
Wuzzy
parents: 922
diff changeset
   143
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
   144
== Updating an existing translation ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   145
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
   146
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
   147
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
   148
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
   149
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
   150
== Creating a new translation ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   151
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   152
That is easy, too. Make a copy of the English file and rename it to use the language code. For the files in the `misc` directory, you need to add an additional line for your language (if it is missing).
368
2982cf17f347 Edited wiki page Translations through web user interface. Mention stub.lua
pntanasis@gmail.com
parents: 367
diff changeset
   153
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
   154
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
   155
1090
a97043d9df1f Translations: fix typo
Wuzzy
parents: 1089
diff changeset
   156
Example for French:
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   157
1085
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   158
 * Copy `en.txt` to `fr.txt`
f90f098fb347 Translations: Add overview
Wuzzy
parents: 1084
diff changeset
   159
 * Copy `stub.lua` to `fr.lua`
1090
a97043d9df1f Translations: fix typo
Wuzzy
parents: 1089
diff changeset
   160
 * Copy `tips_en.xml` to `tips_fr.xml`
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   161
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
   162
== Testing the translations ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   163
1090
a97043d9df1f Translations: fix typo
Wuzzy
parents: 1089
diff changeset
   164
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
   165
1090
a97043d9df1f Translations: fix typo
Wuzzy
parents: 1089
diff changeset
   166
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
   167
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
   168
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
   169
== Sharing the translations ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   170
496
24ffc984d617 Copy editing, add tips_en.xml to list of translation files
almikes@aol.com
parents: 368
diff changeset
   171
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
   172
1050
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   173
 # Talk with a Hedgewars developer in order to include it in the next Hedgewars release. This is the best possible solution
2050
840125d4a254 Translations: fix DLC lnk
Wuzzy
parents: 2049
diff changeset
   174
 # Talk with a Hedgewars developer in order to include it in [https://hedgewars.org/wiki/Downloadable_Content DLC]
905
fc5ec399d9cf Translations: make DLC link clickable
Wuzzy
parents: 884
diff changeset
   175
 # 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
1050
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   176
2198
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   177
== Translation conventions ==
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   178
=== Hedgehog and team names ===
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   179
When it comes to the names of hedgehogs and teams and other names of related story elements, you can and should feel free to translate those names to your own language. You can be creative and humorous about it, the translation of names does not have to be literal. We want to make the names feel "natural" in foreign languages, too.
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   180
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   181
For example, the name of the hedgehog “Leaks a Lot” has been translated as “Undichte Stelle” in German. German-speaking players find it quite hilarious. ;-)
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   182
2199
7ebe3891ffa5 Translations: copy name
Wuzzy
parents: 2198
diff changeset
   183
But ultimately, you are the translator of the game, the final decision what to do with names is still up to you. You can still choose to just copy the exact name, if you think that’s most appropriate.
7ebe3891ffa5 Translations: copy name
Wuzzy
parents: 2198
diff changeset
   184
7ebe3891ffa5 Translations: copy name
Wuzzy
parents: 2198
diff changeset
   185
Our only hard rule is that once you picked a name translation, you must make sure it is used consistently everywhere.
2198
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   186
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   187
=== Hedgewars ===
2203
9e15e7766b70 Translations: fix italic
Wuzzy
parents: 2202
diff changeset
   188
The name of the game “Hedgewars” should always be “Hedgewars”, in all languages. Please do *not* change the name of the game in your translation without talking to us first. If you think the game name absolutely _must_ be translated for some reason, please talk to us first and let’s see if we can work something out.
2198
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   189
8fdee09037a9 Translations: Add conventions
Wuzzy
parents: 2197
diff changeset
   190
=== Abbreviations ===
1050
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   191
You will find a few abbreviations in the files. here's what they mean:
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   192
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   193
 * *PAotH*: Planetary Association of the Hedgehogs
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   194
 * *Hog Solo and GB*: Hog Solo and Green Bananas
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   195
 * *RS1*: Red Strawberries 1
e27becdecbce Translations: more abbreviations
Wuzzy
parents: 1049
diff changeset
   196
 * *RS2*: Red Strawberries 2
1052
1c45c17f118a Translations: minute
Wuzzy
parents: 1051
diff changeset
   197
 * *fps*: frames per second
1c45c17f118a Translations: minute
Wuzzy
parents: 1051
diff changeset
   198
 * *s*: second ([https://en.wikipedia.org/wiki/International_System_of_Units SI unit] of time)
1c45c17f118a Translations: minute
Wuzzy
parents: 1051
diff changeset
   199
 * *min*: minute
1c45c17f118a Translations: minute
Wuzzy
parents: 1051
diff changeset
   200
751
d9b0213fc1a3 Translations: Add title, fix header levels
Wuzzy
parents: 670
diff changeset
   201
== Things to have in mind ==
365
54349158cbff Created wiki page about translations.
pntanasis@gmail.com
parents:
diff changeset
   202
1084
37eb1e994b1f Translations: chatroom link
Wuzzy
parents: 1083
diff changeset
   203
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 [https://hedgewars.org/chat our chatroom] in cases like that.
1047
fb4797358321 Translations: Add abbreviations
Wuzzy
parents: 1036
diff changeset
   204
1084
37eb1e994b1f Translations: chatroom link
Wuzzy
parents: 1083
diff changeset
   205
Feel free to translate hedgehog and team names into your own language, when it makes sense. Remember that most names are meant to be funny and puns are not uncommon. The game should be enjoyable in all languages.