Difference between revisions of "Translate X-Moto and X-Moto Website into your language"

From X-Moto
Jump to: navigation, search
(How to create the .mo file)
(From Windows)
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
=Who can do this=
+
=How can I do this=
 
Translate X-Moto game or X-Moto website is very easy. This is not technical at all.
 
Translate X-Moto game or X-Moto website is very easy. This is not technical at all.
Anybody who speaks english and an other language can do this.
+
Anybody who speaks English and an other language can do this.
  
 
=How does it work ?=
 
=How does it work ?=
 
X-Moto and X-Moto website are written fully in english. However, the GNU tools gives a mechanism to translate any sentences into an other one. To do that, you have to write a file giving all the conversions (to answer to the question "How to you say ... into your language ?").
 
X-Moto and X-Moto website are written fully in english. However, the GNU tools gives a mechanism to translate any sentences into an other one. To do that, you have to write a file giving all the conversions (to answer to the question "How to you say ... into your language ?").
 
This file is called a po file. Then, there is a fr.po for the french translation, a es.po, a ru.po, ... one for each language.
 
This file is called a po file. Then, there is a fr.po for the french translation, a es.po, a ru.po, ... one for each language.
A .po file is a simple text file where you can associate to each msgid (message identifier) a msgstr (message string). You can open it with any text editor, however, poedit for windows or kbabel for linux will help you to translate.
+
A .po file is a simple text file where you can associate to each msgid (message identifier) a msgstr (message string). You can open it with any text editor, however, poedit for windows or lokalize (kbabel) for linux will help you to translate.
  
 
Example :
 
Example :
Line 23: Line 23:
  
 
=Where to get the .po file=
 
=Where to get the .po file=
 +
 +
When you start a translation, always take the last version available on the link below in the case somebody else updated it since the last time you downloaded it.
  
 
==For the X-Moto game==
 
==For the X-Moto game==
 
if X-Moto is not translated into your language, your must start with this file
 
if X-Moto is not translated into your language, your must start with this file
http://viewvc.tuxfamily.org/svn_xmoto_xmoto/trunk/po/xmoto.pot?view=markup
+
http://svn.tuxfamily.org/viewvc.cgi/trunk/po/?root=xmoto_xmoto
  
 
==For the website==
 
==For the website==
 
if the website is not translated into your language, your must start with this file
 
if the website is not translated into your language, your must start with this file
http://viewvc.tuxfamily.org/svn_xmoto_xmotowebsite/trunk/locales/xmoto_highscores.po?view=markup
+
http://svn.tuxfamily.org/viewvc.cgi/trunk/locales/?root=xmoto_xmotowebsite
  
 
=How to create the .mo file=
 
=How to create the .mo file=
Line 41: Line 43:
  
 
==From Windows==
 
==From Windows==
* get from http://viewvc.tuxfamily.org/svn_xmoto_xmoto/trunk/tools/windows_translation/xmoto_translation/
+
* [http://svn.tuxfamily.org/viewvc.cgi/trunk/tools/windows_translation/xmoto_translation/?root=xmoto_xmoto X-Moto Translation]
 
 
 
  makeMyTranslation.bat
 
  makeMyTranslation.bat
 
  showMissingTranslation.bat
 
  showMissingTranslation.bat
Line 60: Line 61:
  
 
=How to update a .po file=
 
=How to update a .po file=
 +
On GNU/Linux
 +
make update-po
 +
 +
=About translation itself=
 +
==What's #fuzzy==
 +
#fuzzy means that gettext tried to translate by itself. It's generally not good at all.
 +
 +
===Example :===
 +
#: src/GameText.h:185
 +
#, fuzzy
 +
msgid "Failed to update the theme list"
 +
msgstr "Mettre à jour la liste"
 +
 +
must be changed to become
 +
 +
#: src/GameText.h:185
 +
msgid "Failed to update the theme list"
 +
msgstr "Echec lors de la mise à jour du thème"
 +
 +
==What's the last lines at the end of the .po starting by #~==
 +
You can remove these lines. It's translation which doesn't exist anymore in xmoto.
 +
 +
===Example :===
 +
#~ msgid "Flip left 2"
 +
#~ msgstr "Pencher à gauche 2"
 +
 +
#~ msgid "Flip right 2"
 +
#~ msgstr "Pencher à droite 2"
  
 
=Need help ?=
 
=Need help ?=
 
If you need any help or want to propose your .po, just write to us here :
 
If you need any help or want to propose your .po, just write to us here :
  
http://xmoto.tuxfamily.org/index.php?page=messages
+
[http://xmoto.tuxfamily.org/index.php?page=messages Messages]
 +
 
 +
==Untranslated messages==
 +
To see untranslated messages, just run
 +
msgattrib --untranslated fr_FR.po
 +
msgattrib --fuzzy fr_FR.po

Latest revision as of 22:00, 12 March 2013

How can I do this

Translate X-Moto game or X-Moto website is very easy. This is not technical at all. Anybody who speaks English and an other language can do this.

How does it work ?

X-Moto and X-Moto website are written fully in english. However, the GNU tools gives a mechanism to translate any sentences into an other one. To do that, you have to write a file giving all the conversions (to answer to the question "How to you say ... into your language ?"). This file is called a po file. Then, there is a fr.po for the french translation, a es.po, a ru.po, ... one for each language. A .po file is a simple text file where you can associate to each msgid (message identifier) a msgstr (message string). You can open it with any text editor, however, poedit for windows or lokalize (kbabel) for linux will help you to translate.

Example :

#: src/GameText.h:53
msgid "Automatic saving of replays"
msgstr ""

becomes for the french translation

#: src/GameText.h:53
msgid "Automatic saving of replays"
msgstr "Sauvegarde automatique des replays"

Lines starting by a # are ignored.

Where to get the .po file

When you start a translation, always take the last version available on the link below in the case somebody else updated it since the last time you downloaded it.

For the X-Moto game

if X-Moto is not translated into your language, your must start with this file http://svn.tuxfamily.org/viewvc.cgi/trunk/po/?root=xmoto_xmoto

For the website

if the website is not translated into your language, your must start with this file http://svn.tuxfamily.org/viewvc.cgi/trunk/locales/?root=xmoto_xmotowebsite

How to create the .mo file

From GNU/Linux

# edit your po/*.po file 
cd po
make update-po
make install

From Windows

makeMyTranslation.bat
showMissingTranslation.bat
bin/libgettextlib.dll
bin/libgettextsrc.dll
bin/libiconv2.dll
bin/libintl3.dll
bin/msgfmt.exe
  • Copy the the two .bat and the bin dir into
c:/Program Files/X-Moto/locales/your_lang/LC_MESSAGES

just next to the existing xmoto.mo

  • Rename your .po into xmoto.po and it there too, so that in the same dir, you've xmoto.po, xmoto.mo, bin and the two .bat
  • update your .po
  • clic on the .bat of your choice (showMissingTranslation to get the error lines and makeMyTranslation to build the .mo)

How to update a .po file

On GNU/Linux

make update-po

About translation itself

What's #fuzzy

  1. fuzzy means that gettext tried to translate by itself. It's generally not good at all.

Example :

#: src/GameText.h:185
#, fuzzy
msgid "Failed to update the theme list"
msgstr "Mettre à jour la liste"

must be changed to become

#: src/GameText.h:185
msgid "Failed to update the theme list"
msgstr "Echec lors de la mise à jour du thème"

What's the last lines at the end of the .po starting by #~

You can remove these lines. It's translation which doesn't exist anymore in xmoto.

Example :

#~ msgid "Flip left 2"
#~ msgstr "Pencher à gauche 2"

#~ msgid "Flip right 2"
#~ msgstr "Pencher à droite 2"

Need help ?

If you need any help or want to propose your .po, just write to us here :

Messages

Untranslated messages

To see untranslated messages, just run

msgattrib --untranslated fr_FR.po
msgattrib --fuzzy fr_FR.po