<tt>/kvtml/data/</tt>. The file <tt>easy.kvtml</tt> is for easy-to-guess words, the file <tt>medium.kvtml</tt> is for level medium, the file <tt>animals.kvtml</tt> is for guessing animals names and the file <tt>hard.kvtml</tt> is for difficult-to-guess words.

<tt>/kvtml/data/</tt>. The file <tt>easy.kvtml</tt> is for easy-to-guess words, the file <tt>medium.kvtml</tt> is for level medium, the file <tt>animals.kvtml</tt> is for guessing animals names and the file <tt>hard.kvtml</tt> is for difficult-to-guess words.

English is the default and thus the only language to be shipped with KHangMan. All other language data are put in the corresponding l10n-kde4 module.

English is the default and thus the only language to be shipped with KHangMan. All other language data are put in the corresponding l10n-kde4 module.

−

You can download the source with the English files here: [http://edu.kde.org/khangman/add_language/khangman-data.tar.gz|khangman-data.tar.gz]

+

You can download the source with the English files here: [http://edu.kde.org/khangman/add_language/khangman-data.tar.gz khangman-data.tar.gz]

The files use the '''kvtml format'''. The tag &lt;text&gt; is for the word and the tag &lt;comment&gt; is for the hint, those are within a &lt;entry&gt; tag. Please try to match the hint with the level of difficulty. The level 'Easy' will require an easy hint but the level 'Hard' will require the definition in the dictionary. Try not to use words of the same family in the hint, that would give the word away too easily!

The files use the '''kvtml format'''. The tag &lt;text&gt; is for the word and the tag &lt;comment&gt; is for the hint, those are within a &lt;entry&gt; tag. Please try to match the hint with the level of difficulty. The level 'Easy' will require an easy hint but the level 'Hard' will require the definition in the dictionary. Try not to use words of the same family in the hint, that would give the word away too easily!

Line 46:

Line 46:

&lt;/kvtml&gt;

&lt;/kvtml&gt;

</pre>

</pre>

−

</p>

+

At the beginning of the file, you should translate the content of the &lt;title&gt; and &lt;comment&gt; tags which are within the &lt;information&gt; tag. The title will be the one that will appear in the Category menu of the game (where the user chooses the file to play with).

At the beginning of the file, you should translate the content of the &lt;title&gt; and &lt;comment&gt; tags which are within the &lt;information&gt; tag. The title will be the one that will appear in the Category menu of the game (where the user chooses the file to play with).

Then within the &lt;identifier&gt; tag, please put your language code instead of <tt>en</tt> in &lt;locale&gt;.

Then within the &lt;identifier&gt; tag, please put your language code instead of <tt>en</tt> in &lt;locale&gt;.

Line 57:

Line 57:

'''If you have special characters''' in your language such the accented letters in French, you can write them in a file named &lt;yourlang&gt;.txt, one character per line and save that as UTF-8. Then you also have to add in the CMakeLists.txt the following:

'''If you have special characters''' in your language such the accented letters in French, you can write them in a file named &lt;yourlang&gt;.txt, one character per line and save that as UTF-8. Then you also have to add in the CMakeLists.txt the following:

Note that <b>you must use UTF-8 encoding</b> when editing the files. If your editor can't do this, try using kwrite or kate. When opening a file in kwrite or kate you can select utf8 encoding with the top right combo box.

Note that <b>you must use UTF-8 encoding</b> when editing the files. If your editor can't do this, try using kwrite or kate. When opening a file in kwrite or kate you can select utf8 encoding with the top right combo box.

Line 65:

Line 65:

==Contact==

==Contact==

−

Please contact <a href="mailto:annma AT kde DOT org">me</a> if there is anything special related to your language so I can adapt the code to it (especially the special and accented characters).

+

Please contact [mailto:annma@kde.org annma] if there is anything special related to your language so I can adapt the code to it (especially the special and accented characters).

Good luck and many thanks!

Good luck and many thanks!

Revision as of 16:39, 19 July 2012

About KHangMan

Translate Words in your language

Here is a an outline of the steps necessary to translate the words of
the game to your language. Please note that you can adapt the words as you want as long as you keep words corresponding to the level.
KHangMan shares its files with KAnagram so you might also want to have a look at KAnagram website.
The words are stored in 4 separate files, one for each level. The files are in
/kvtml/data/. The file easy.kvtml is for easy-to-guess words, the file medium.kvtml is for level medium, the file animals.kvtml is for guessing animals names and the file hard.kvtml is for difficult-to-guess words.
English is the default and thus the only language to be shipped with KHangMan. All other language data are put in the corresponding l10n-kde4 module.
You can download the source with the English files here: khangman-data.tar.gz

The files use the kvtml format. The tag <text> is for the word and the tag <comment> is for the hint, those are within a <entry> tag. Please try to match the hint with the level of difficulty. The level 'Easy' will require an easy hint but the level 'Hard' will require the definition in the dictionary. Try not to use words of the same family in the hint, that would give the word away too easily!

At the beginning of the file, you should translate the content of the <title> and <comment> tags which are within the <information> tag. The title will be the one that will appear in the Category menu of the game (where the user chooses the file to play with).
Then within the <identifier> tag, please put your language code instead of en in <locale>.
Please don't translate the file name itself as filenames should never contain any special charaters. Thus please save your file with the same English filenames.

Edit the kvtml files with a text editor (it will be easier if you use the XML syntax highlighting) and replace each word inside the <text> tag with a translated word and each hint inside a <comment> with a translated hint. It is not really important that the exact meaning is preserved, but try to keep the length and level of difficulty roughly the same. You can include words with white space or - in them, in that case the white space or the - will be shown instead of the _.

You can just translate the words but you can also adapt them following the level and add new words if you want. For example, "table" is in level easy in English but in your language, it can be level medium. Feel free to adapt the files to your language needs. The number of words in a file is not important, you can add some if you want.

If you have special characters in your language such the accented letters in French, you can write them in a file named <yourlang>.txt, one character per line and save that as UTF-8. Then you also have to add in the CMakeLists.txt the following:

Note that you must use UTF-8 encoding when editing the files. If your editor can't do this, try using kwrite or kate. When opening a file in kwrite or kate you can select utf8 encoding with the top right combo box.

You can then commit your files in l10n-kde4/<lang_code>/data/kdeedu/khangman. Don't forget to update the CMakeLists.txt file as well.

Contact

Please contact annma if there is anything special related to your language so I can adapt the code to it (especially the special and accented characters).