Translations.wiki
changeset 1085 f90f098fb347
parent 1084 37eb1e994b1f
child 1086 3333fe1e418d
equal deleted inserted replaced
1084:37eb1e994b1f 1085:f90f098fb347
    39 For Windows 8, the path is `C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale`.
    39 For Windows 8, the path is `C:\Program Files (x86)\Hedgewars 0.9.19\Data\Locale`.
    40 
    40 
    41 == Translation files ==
    41 == Translation files ==
    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. You can edit all these files with a text editor, but for some files special editors are available.
    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. You can edit all these files with a text editor, but for some files special editors are available.
    43 
    43 
       
    44 === Overview ===
       
    45 These are all files which contain translatable text. Replace “ZZ” with the [https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes ISO 639-1 language code] (e.g. “de” for German).
       
    46 
       
    47  * `/share/hedgewars/Data/Locale/ZZ.txt`—In-game strings
       
    48  * `/share/hedgewars/Data/Locale/ZZ.lua`—Script transations
       
    49  * `/share/hedgewars/Data/Locale/hedgewars_ZZ.ts`–Frontend
       
    50  * `/share/hedgewars/Data/Locale/missions_ZZ.txt`—Mission names and descriptions
       
    51  * `/share/hedgewars/Data/Locale/campaigns_ZZ.txt`—Campaign names and descriptions
       
    52  * `/share/hedgewars/Data/Locale/tips_ZZ.xml`—Main menu tips
       
    53  * `/share/hedgewars/Data/Maps/<map name>/desc.txt`—Mission map descriptions
       
    54  * `/share/hedgewars/Data/misc/hedgewars.desktop`—[https://wiki.freedesktop.org/www/Specifications/desktop-entry-spec/ Desktop Entry] file for Hedgewars
       
    55  * `/share/hedgewars/Data/misc/hwengine.desktop`—**Do not translate!**
       
    56  * `/share/hedgewars/Data/misc/hwengine.desktop.in`—Desktop Entry file for the engine
       
    57  * `/share/hedgewars/Data/misc/hedgewars-mimeinfo.xml`—File type descriptions
       
    58 
    44 === Engine (in-game stuff) ===
    59 === Engine (in-game stuff) ===
    45  * `/share/hedgewars/Data/Locale/en.txt`—This contains the core in-game strings, such as the mission panel, the messages at the top, ammo names and descriptions (see below)
    60  * `/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)
    46  * `/share/hedgewars/Data/Locale/stub.lua`—Strings used by Lua scripts, which includes campaigns, missions and game styles (see below)
    61  * `/share/hedgewars/Data/Locale/ZZ.lua`—Strings used by Lua scripts, which includes campaigns, missions and game styles (see below)
    47 
    62 
    48 ==== `.txt` files ====
    63 ==== `.txt` files ====
    49 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”.
    64 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”.
    50 
    65 
    51 Each line must contain a single translation and follows this format:
    66 Each line must contain a single translation and follows this format:
    85 In case you need to include a quotation mark in your translation, write `\"` instead of `"`.
   100 In case you need to include a quotation mark in your translation, write `\"` instead of `"`.
    86 
   101 
    87 Note to programmers: These `.lua` files are actually containing real Lua source code.
   102 Note to programmers: These `.lua` files are actually containing real Lua source code.
    88 
   103 
    89 === Frontend (main menu) ===
   104 === Frontend (main menu) ===
    90  * `/share/hedgewars/Data/Locale/hedgewars_en.ts`—Contains most strings of the frontend and you can edit it with Qt Linguist
   105  * `/share/hedgewars/Data/Locale/hedgewars_ZZ.ts`—Contains most strings of the frontend and you can edit it with Qt Linguist
    91  * `/share/hedgewars/Data/Locale/missions_en.txt`—This is the [Missions mission] description strings
   106  * `/share/hedgewars/Data/Locale/missions_ZZ.txt`—This is the [Missions mission] description strings
    92  * `/share/hedgewars/Data/Locale/campaigns_en.txt`—This is the campaign description strings
   107  * `/share/hedgewars/Data/Locale/campaigns_ZZ.txt`—This is the campaign description strings
    93  * `/share/hedgewars/Data/Locale/tips_en.xml`—This contains the tips shown in the main menu. This file is *not* in XML format!
   108  * `/share/hedgewars/Data/Locale/tips_ZZ.xml`—This contains the tips shown in the main menu. This file is *not* in XML format!
    94 
   109 
    95 ==== Mission map descriptions ====
   110 ==== Mission map descriptions ====
    96 The map selection shows brief descriptions for mission maps below the preview image. Those can be translated and you find those texts in:
   111 The map selection shows brief descriptions for mission maps below the preview image. Those can be translated and you find those texts in:
    97 
   112 
    98  * `/share/hedgewars/Data/Maps/<map name>/desc.txt`
   113  * `/share/hedgewars/Data/Maps/<map name>/desc.txt`
   120 
   135 
   121 The `en.lua` file doesn’t exist. The strings are hard coded in the code.
   136 The `en.lua` file doesn’t exist. The strings are hard coded in the code.
   122 
   137 
   123 == Creating a new translation ==
   138 == Creating a new translation ==
   124 
   139 
   125 That is easy, too. Make a copy of the English file and rename it to use the initials of your language.
   140 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).
   126 
   141 
   127 The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
   142 The `en.lua` file doesn’t exist. Use `stub.lua` instead as your template.
   128 
   143 
   129 Here are 3 examples:
   144 Exampl for French:
   130 
   145 
   131  * For French copy `en.txt` to `fr.txt`
   146  * Copy `en.txt` to `fr.txt`
   132  * For Spanish copy `en.txt` to `es.txt`
   147  * Copy `stub.lua` to `fr.lua`
   133  * For Greek copy `en.txt` to `el.txt`
   148  * Copy `hedgewars_en.ts` to `hedgewars_fr.ts`
   134 
   149 
   135 == Testing the translations ==
   150 == Testing the translations ==
   136 
   151 
   137 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
   152 When finished you have just to start Hedgewars and choose your language from the Game Preferences, Advanced tab.
   138 
   153