Difference between revisions of "Projects/Edu/Khangman"

< Projects‎ | Edu
Jump to: navigation, search
(About KHangMan)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Projects/KHangMan}}
+
 
  
 
==About KHangMan==
 
==About KHangMan==
  
Refer to [http://userbase.kde.org/KHangMan]
+
Refer to [http://userbase.kde.org/KHangMan http://userbase.kde.org/KHangMan]
 +
 
 +
==[[/QA List 2.5|QA List for KHangMan 2.5 on KDE 4.10, desktop edition]]==
  
 
==Translate Words in your language==
 
==Translate Words in your language==
Line 13: Line 15:
 
<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: <a href="khangman-data.tar.gz">khangman-data.tar.gz</a>.
+
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 48:
 
&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 59:
 
'''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:
  
<tt>install( FILES  &lt;yourlang&gt;.txt  DESTINATION ${DATA_INSTALL_DIR}/khangman )</tt>.</p>
+
<tt>install( FILES  &lt;yourlang&gt;.txt  DESTINATION ${DATA_INSTALL_DIR}/khangman )</tt>.
  
 
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 67:
 
==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!

Latest revision as of 18:03, 4 December 2012


Contents

[edit] About KHangMan

Refer to http://userbase.kde.org/KHangMan

[edit] QA List for KHangMan 2.5 on KDE 4.10, desktop edition

[edit] 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!


An example of a kvtml file is as follow:

<?xml version="1.0"?> 
<DOCTYPE kvtml PUBLIC "kvtml2.dtd" "http://edu.kde.org/kanagram/kvtml2.dtd"> 
<kvtml version="2.0"> 
<information>
    <generator>converter</generator>
    <title>Animals</title><!--Translate tag content-->
    <comment>Animals from across the planet</comment><!--Translate tag content-->
  </information>
  <identifiers>
    <identifier id="0" >
      <locale>en</locale>
    </identifier>
  </identifiers>
...
<entry id="0" >
      <inactive>false</inactive>
      <inquery>false</inquery>
      <translation id="0" >
        <text>bear</text><!--Translate all text tags content-->
        <comment>Large heavy animal with thick fur</comment><!--Translate all comment tags content-->
      </translation>
    </entry>
...
</kvtml>
 

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:

install( FILES <yourlang>.txt DESTINATION ${DATA_INSTALL_DIR}/khangman ).

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.

[edit] 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).

Good luck and many thanks!


This page was last modified on 4 December 2012, at 18:03. This page has been accessed 3,084 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal