Translations.wiki
changeset 751 d9b0213fc1a3
parent 670 32fdba27f330
child 798 30c5f1ebd552
equal deleted inserted replaced
750:bb84e70c01b7 751:d9b0213fc1a3
     1 #summary This is a guide for new translators.
     1 #summary This is a guide for new translators.
     2 
     2 
     3 = Introduction =
     3 = Translations =
       
     4 == Introduction ==
     4 
     5 
     5 This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
     6 This is a guide for translators. In order to translate Hedgewars into another language you are going to need:
     6 
     7 
     7  # The latest Hedgewars localization files
     8  # The latest Hedgewars localization files
     8  # A text editor like Notepad++, Geany, Vim, etc.
     9  # A text editor like Notepad++, Geany, Vim, etc.
     9  # Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
    10  # Qt4 Linguist. To download the Qt4 Linguist you have to download the Qt4 SDK.
    10 
    11 
    11 = Getting the localization files =
    12 == Getting the localization files ==
    12 
    13 
    13 To get the Hedgewars localization files there are 4 possible ways.
    14 To get the Hedgewars localization files there are 4 possible ways.
    14 
    15 
    15  * *A*. Clone the Hedgewars source repository.
    16  * *A*. Clone the Hedgewars source repository.
    16  * *B*. Download the latest Hedgewars source code.
    17  * *B*. Download the latest Hedgewars source code.
    26 
    27 
    27 The *D* way is to download the desired files from [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Locale/ here].
    28 The *D* way is to download the desired files from [http://hg.hedgewars.org/hedgewars/raw-file/default/share/hedgewars/Data/Locale/ here].
    28 
    29 
    29 Above I am going to discuss the *C* way (Find the localization files in your current Hedgewars installation).
    30 Above I am going to discuss the *C* way (Find the localization files in your current Hedgewars installation).
    30 
    31 
    31 == Finding the localization files ==
    32 === Finding the localization files ===
    32 
    33 
    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.
    34 In GNU/Linux you have to look into `/path-to-Hedgewars/Data/Locale where path-to-Hedgewars` is the path to your Hedgewars installation.
    34 
    35 
    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.
    36 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.
    36 
    37 
    37 For example in an Arch Linux box the path is `/usr/share/Hedgewars/Data/Locale`.
    38 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`.
    39 In a Windows 8 box the path is `C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale`.
    39 
    40 
    40 = Translation files =
    41 == Translation files ==
    41 
    42 
    42 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.
    43 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.
    43 
    44 
    44  * `/share/hedgewars/Data/Locale/en.txt`—This is the engine's strings
    45  * `/share/hedgewars/Data/Locale/en.txt`—This is the engine's strings
    45  * `/share/hedgewars/Data/Locale/hedgewars_en.ts`—This is the front-end's strings and you can edit it with Qt Linguist
    46  * `/share/hedgewars/Data/Locale/hedgewars_en.ts`—This is the front-end's strings and you can edit it with Qt Linguist
    53  * `/share/hedgewars/Data/misc/hedgewars.desktop`—[https://wiki.freedesktop.org/www/Specifications/desktop-entry-spec/ Desktop Entry] file for the Hedgewars application
    54  * `/share/hedgewars/Data/misc/hedgewars.desktop`—[https://wiki.freedesktop.org/www/Specifications/desktop-entry-spec/ Desktop Entry] file for the Hedgewars application
    54  * `/share/hedgewars/Data/misc/hwengine.desktop.in`—Desktop Entry file for the Hedgewars engine for playing savegames and demos
    55  * `/share/hedgewars/Data/misc/hwengine.desktop.in`—Desktop Entry file for the Hedgewars engine for playing savegames and demos
    55  * `/share/hedgewars/Data/misc/hwengine.desktop`—*Do not translate*! This file will be automatically generated from `hwengine.desktop.in` when building Hedgewars
    56  * `/share/hedgewars/Data/misc/hwengine.desktop`—*Do not translate*! This file will be automatically generated from `hwengine.desktop.in` when building Hedgewars
    56  * `/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml`—Description of Hedgewars file types
    57  * `/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml`—Description of Hedgewars file types
    57 
    58 
    58 = Updating an existing translation =
    59 == Updating an existing translation ==
    59 
    60 
    60 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.
    61 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.
    61 
    62 
    62 The `en.lua` file doesn’t exist. The strings are hard coded in the code.
    63 The `en.lua` file doesn’t exist. The strings are hard coded in the code.
    63 
    64 
    64 = Creating a new translation =
    65 == Creating a new translation ==
    65 
    66 
    66 That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
    67 That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
    67 
    68 
    68 The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
    69 The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
    69 
    70 
    71 
    72 
    72  * For French copy `en.txt` to `fr.txt`
    73  * For French copy `en.txt` to `fr.txt`
    73  * For Spanish copy `en.txt` to `es.txt`
    74  * For Spanish copy `en.txt` to `es.txt`
    74  * For Greek copy `en.txt` to `el.txt`
    75  * For Greek copy `en.txt` to `el.txt`
    75 
    76 
    76 = Testing the translations =
    77 == Testing the translations ==
    77 
    78 
    78 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
    79 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
    79 
    80 
    80 If a translation is missing then the string is going to be displayed in English.
    81 If a translation is missing then the string is going to be displayed in English.
    81 Note that you should restart the frondend for the language changes to take effect.
    82 Note that you should restart the frondend for the language changes to take effect.
    82 
    83 
    83 = Sharing the translations =
    84 == Sharing the translations ==
    84 
    85 
    85 In order to share your translations with Hedgewars community there are 3 possible ways:
    86 In order to share your translations with Hedgewars community there are 3 possible ways:
    86 
    87 
    87  # 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.
    88  # 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.
    88  # Talk with a Hedgewars developer in order to include it in DLC (http://Hedgewars.org/content.html)
    89  # Talk with a Hedgewars developer in order to include it in DLC (http://Hedgewars.org/content.html)
    89  # Talk with a Hedgewars developer in order to include it in the next Hedgewars release.
    90  # Talk with a Hedgewars developer in order to include it in the next Hedgewars release.
    90 
    91 
    91 = Things to have in mind =
    92 == Things to have in mind ==
    92 
    93 
    93 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.
    94 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.