Can someone that has done a full translation please create a short howto on how it is done please.
Sorry, I haven't enough time to learn the wiki language and edit the page. Hope someone will be able to update it with my little experience explanation (and correct all my english faults
).
I don't know if this is the best way to work on translations, but here is what I did (or should have done) when v7.0b8 came out :
Work space :I did all my work in a public i-bay. Here is my directories architecture :
html
traduction FYI, means translation in french
fr_FR contains all my working files but versions archives
po translated console .po files
root root directory
etc /etc directory with the translated manager files
...
v7b8 first release I worked on
po original console POT files
root root directory
etc /etc directory with the original manager files
...
v7b9 second release I worked on
...
... et-caetera
If needed, you can see the content of my
traduction directory.
Console translation :This part is quite easy, you just have to copy and edit
/usr/share/locale/en_US/LC_MESSAGES/*.po (let's call them POT). Each message has to be translated this way :
#: root/sbin/e-smith/console:134
msgid "Bad ttyname:"
msgstr "Nom de terminal TTY erroné :"
First line is a comment that tells where to find the message (/sbin/e-smith/console, line 134).
Second line is the original message. You
mustn't change it !
Third line is the translation. Be careful not to use the double-quote character ("), or escape it.
If the message is too long, you can split it on as many lines as required. Be careful not to forget spaces at the end of the lines. For exemple :
#: root/sbin/e-smith/console:184
msgid "Consult the User Guide for further instructions."
msgstr ""
"Consultez la documentation utilisateur pour obtenir de plus amples "
"informations."
If your language translation doesn't exist, or needs corrections, you should consider working on a copy of the POT files and copy/paste relevant translations.
Otherwise, if it's the first time you work on the translation, you must verify that there is no missing messages on your version, compared to the original POT files.
I now consider you work on the server-console.po file (the most important file).
Once it is translated, you can test it. Here is what you can do to try it (modify the fr directory with the one for your language) :
- save existing translated file (same name, but .mo extension) :
mv /usr/share/locale/fr/LC_MESSAGES/server-console.mo /usr/share/locale/fr/LC_MESSAGES/server-console.mo.saved- compile your .po file :
msgfmt -o /usr/share/locale/fr/LC_MESSAGES/server-console.mo server-console.po
- run the console and test as many panels as you can
If you find errors, modify .po file, compile it, test it, etc.
In case of problem, you can revert to the original file you saved.
Note 1 : if you need to work with your language .po files (yet translated POT files), you can obtain it one of these ways :
- de-compile .mo files : msgunfmt -o file.po file.mo
- get the latest source SRPM of smeserver-locale in the
buildsNote 2 : on SME v6, msgfmt doesn't exist ; you must use msgfmt2.py (options are the same)
Note 3 : on SME v6, msgunfmt doesn't exist ; you must de-compile on SME v7
Manager translation :All original files are XML files located in sub-directory of
/etc/e-smith/locale/en-us/If your language has yet been translated but need corrections, you can work on a copy of them and compare each entry of each file with the original ones. Otherwise, copy the tree structure of the original files and translate each message.
Here is an exemple of an original message in the starterwebsite panel :
<entry>
<base>SUCCESS</base>
<trans>Successfully created starter web site (wrote file index.htm).
You can visit your new website at the address below:</trans>
</entry>
and its translation :
<entry>
<base>SUCCESS</base>
<trans>Création réussie de votre premier site Web (écriture du fichier
index.htm). Vous pouvez voir ce nouveau site Web à l'adresse suivante :</trans>
</entry>
Warning : messages that need to include HTML tags must be tagged like this one :
<entry>
<base>DESC_SUBMIT</base>
<trans><![CDATA[
<p>Lorsque vous créerez cette page Web, le fichier "index.htm" sera
écrasé dans le répertoire de votre site primaire.</p>
<p><b>Voulez-vous continuer ?</b></p>
]]></trans>
</entry>
To test your translated file, just copy it in its directory (eg.
/etc/e-smith/locale/fr/etc/e-smith/web/functions/starterwebsite). You should save an existing file before copying it, in case of any problem.
Translations testedOnce you have tested your file(s), you can submit them to the
bug tracker : create a new bug and submit an archive of the files (if possible, respect the tree structure described at the top of this message)
Gavin or I will update the smeserver-locale-* RPMs as soon as possible and after validation, it will be available via yum updates.
Original files modificationsAs the SME development progresses, the original files may change ; and, of course, the translations must reflect these changes.
I personnaly backup original files of each developpment version of SME and then make a diff between the last and the previous version of the most interresting files (seen from the translator). This way, I can be (almost) sure not to forget any modification. See
this message for more informations about the creation of the diif files.
In a neer future, I may create a new bug and attach all the diff files i have made, to help other translators to update their files.
Well, very tired (it's 5:30 AM here), need to go sleeping. I hope there aren't too much mistakes and i haven't forgotten too many things...