Translations.wiki
changeset 496 24ffc984d617
parent 368 2982cf17f347
child 571 76d662d04947
equal deleted inserted replaced
495:729c2ff600fa 496:24ffc984d617
     3 = Introduction =
     3 = Introduction =
     4 
     4 
     5 This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
     5 This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
     6 
     6 
     7  # The latest Hedgewars localization files
     7  # The latest Hedgewars localization files
     8  # A text editor like (notepad++,geany,vim etc)
     8  # A text editor like Notepad++, Geany, Vim, etc.
     9  # Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
     9  # Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
    10 
    10 
    11 = Getting the localization files =
    11 = Getting the localization files =
    12 
    12 
    13 To get the Hedgewars localization files there are 4 possible ways.
    13 To get the Hedgewars localization files there are 4 possible ways.
    14 
    14 
    15 *A*. Clone the Hedgewars source repository.
    15  * *A*. Clone the Hedgewars source repository.
    16 
    16  * *B*. Download the latest Hedgewars source code.
    17 *B*. Download the latest Hedgewars source code.
    17  * *C*. Find the localization files in your current Hedgewars installation.
    18 
    18  * *D*. Download only the specific files to be translated.
    19 *C*. Find the localization files in your current Hedgewars installation.
       
    20 
       
    21 *D*. Download only the specific files to be translated.
       
    22 
    19 
    23 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.
    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.
    24 
    21 
    25 The *B* way is a lot like the *A* way but more limited.
    22 The *B* way is a lot like the *A* way but more limited.
    26 
    23 
    31 
    28 
    32 Above I am going to discuss the *C* way (Find the localization files in your current Hedgewars installation).
    29 Above I am going to discuss the *C* way (Find the localization files in your current Hedgewars installation).
    33 
    30 
    34 == Finding the localization files ==
    31 == Finding the localization files ==
    35 
    32 
    36 In Linux you have to look into /path-to-Hedgewars/Data/Locale where path-to-Hedgewars is the path to your Hedgewars installation.
    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.
    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.
       
    38 
    34 
    39 For example in an Arch Linux box the path is /usr/share/Hedgewars/Data/Locale.
    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.
    40 In a Windows 8 box the path is C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale.
    36 
       
    37 For example in an Arch Linux box the path is `/usr/share/Hedgewars/Data/Locale`.
       
    38 In a Windows 8 box the path is `C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale`.
    41 
    39 
    42 = Translation Files =
    40 = Translation Files =
    43 
    41 
    44 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.
    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.
    45 
    43 
    46 en.txt - This is the engine's strings
    44  * `en.txt`—This is the engine's strings
    47 
    45  * `hedgewars_en.ts`—This is the front-end's strings and you can edit it with Qt Linguist
    48 hedgewars_en.ts - This is the front-end's strings and you can edit it with Qt Linguist
    46  * `missions_en.txt`—This is the mission description strings
    49 
    47  * `campaigns_en.txt`—This is the campaign description strings
    50 missions_en.txt - This is the mission description strings
    48  * `stub.lua`—This is all the Lua files (Missions, maps etc.) strings
    51 
    49  * `tips_en.xml`—This contains the tips shown in the main menu. This file is *not* in XML format!
    52 campaigns_en.txt - This is the campaign description strings
       
    53 
       
    54 stub.lua - This is all the lua files (missions,maps etc) strings
       
    55 
    50 
    56 = Updating an existing translation =
    51 = Updating an existing translation =
    57 
    52 
    58 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.
    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.
    59 
    54 
    60 The en.lua file doesn't exist. The strings are hard coded in the code.
    55 The `en.lua` file doesn’t exist. The strings are hard coded in the code.
    61 
    56 
    62 = Creating a new translation =
    57 = Creating a new translation =
    63 
    58 
    64 That is easy too. Make a copy of the English file and rename it to use the initials of your language.
    59 That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
    65 
    60 
    66 The en.lua file doesn't exist. Use stub.lua instead as your template.
    61 The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
    67 
    62 
    68 Here are 3 examples:
    63 Here are 3 examples:
    69 
    64 
    70 For French copy en.txt to fr.txt
    65  * For French copy `en.txt` to `fr.txt`
    71 
    66  * For Spanish copy `en.txt` to `es.txt`
    72 For Spanish copy en.txt to es.txt
    67  * For Greek copy `en.txt` to `el.txt`
    73 
       
    74 For Greek copy en.txt to el.txt
       
    75 
    68 
    76 = Testing the translations =
    69 = Testing the translations =
    77 
    70 
    78 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
    71 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
       
    72 
    79 If a translation is missing then the string is going to be displayed in English.
    73 If a translation is missing then the string is going to be displayed in English.
    80 Note that you should restart the front-end for the language changes to take effect.
    74 Note that you should restart the frondend for the language changes to take effect.
    81 
    75 
    82 = Sharing the translations =
    76 = Sharing the translations =
    83 
    77 
    84 In order to share your translations with Hedgewars community there are 3 possible ways.
    78 In order to share your translations with Hedgewars community there are 3 possible ways:
    85 
    79 
    86 A. Give them the files and tell them where to place them. Of course this is the less
    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.
    87 convenient way but it is maybe a good approach to let other players double check your
    81  # Talk with a Hedgewars developer in order to include it in DLC (http://Hedgewars.org/content.html)
    88 translations.
    82  # Talk with a Hedgewars developer in order to include it in the next Hedgewars release.
    89 
       
    90 B. Talk with a Hedgewars dev in order to include it in DLC (http://Hedgewars.org/content.html)
       
    91 
       
    92 C. Talk with a Hedgewars dev in order to include it in the next Hedgewars release.
       
    93 
    83 
    94 = Things to have in mind =
    84 = Things to have in mind =
    95 
    85 
    96 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.
    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.