[mythtv] i18n german: Mini i18n Howto.

ramon.roca at xcombo.com ramon.roca at xcombo.com
Fri May 16 23:22:57 EDT 2003

Maybe will be a nice idea to add it to the doc, in the meantime:

Mini i18n howto:

Steps to add a translation to MythTV:

1.-Very first step, choos the language code.
Every language should match a two letter code, ie: English="EN",
Italian="IT", Spanish="ES". Look which two letter code is the appropiate for
the language that you would like to add. If you don't know you can setup
your own linux to that language and then look at "LANG" environment
variable, that will give you a clue.
2.- i18n directories.
Each part of the MythTV code (currently only mythtv and mythweather are
ready for it) will have a i18n directory. There, to add a translation, you

2.1.-Edit "translate.pro" adding the file to be translated. For example, to
add Catalan (ca):

TRANSLATIONS  = mythfrontend_it.ts mythfrontend_es.ts
should change to:
TRANSLATIONS  = mythfrontend_it.ts mythfrontend_es.ts mythfrontend_ca.ts

Look to the existing entries at "TRANSLATIONS" as an example, ie, if you
want to add french, where do you see "mythfrontend_it.ts
mythfrontend_ca.ts..." add "mythfrontend_fr.ts" at the very ñast (to avoid
conflicts while cdommiting the changes), be carefull not to remove any
existing entry.

2.2.-Follow the same step described above, but for the i18n.pro file, in
this case at the "trans.files" entry, note that there the extension is .qm

2.3.-Having QT installed, execute:

$ lupdate translate.pro

That will create your "<program>_<lang>.ts" file within the working
directory. Now yo can edit it to translate your messages. You can do it
either with any editor, however I would recommend "linguist" from trolltech.
Will be likery already installed in your linux if you did install all Qt

2.4.-Once you have finished the tranlation, you should execute:

$ lrelease translate.pro

That will create your *.qm file.

2.5.-Install your translations at your mythtv install directory (change the
Makefile if you want) and then test your translation. Note that you have to
manually update the settings table at mythconverg database.
You can do it in any form that mysql accepts (phpMyAdmin, mysqlnavigator...)
however, to give an example from the mysql prompt:

mysql> use mythconverg;
Database changed.
mysql>update settings set data="CA" where value="Language"

Check here that everything is being displayed correctly, no trimmed
messages, etc, repeat from 2.3 if necessary.

3.- ui xml files.
Many messages within the MythTV application are distributed to several .xml
files. That's because MythTV is highly themeable, wich is good, but you
might want to translate those messages as well. To do it
you can simply find all the files hat have .xml as a extension, i.e. within
the mythtv root directory:

$ find . -name "*.xml" -print

That will give a complete list of all the .xml files (menus, ui, themes...).

Just go to each xml file and edit it. You'll probably find already
translated messages there, you can recognize them because they have the
"lang=XX" attribute (where XX is the language code). You can then simply
copy that line and create a new one. Then change the lang code to de new one
and translate the message. As an example:

Find "lang=" at the xml file.

If you find and entry like:
<value lang="IT">Registrazioni</value>
Go to the very end of the translated messages and add your one:
<value lang="IT">Registrazioni</value>
<value lang="CA">Gravació</value>  <--- assuming that this is the new line
you just added.
Again, always add your new line after the last to avoid conflicts.

There is no need for any special modification to the makefiles to install
the new xml files to the working directory, to test you translation you
should simply run the mythtv "make install" as usual and then, test it.

4.-Setup dialog.
Add your language at globalsettings.cpp to be able to choose it from the
setup dialog.

5.-Packing and submiting your translation to the current CVS.
Once you are comfortable with your translation, diff your translated xml
files and patched .pro files with the current cvs. You can do it with:

cvs diff -u <file to be comparted>  > <file to be compared>.diff

Take a look to the generated .diff file to be sure that you are not
affecting by mistake any other translation/part of the code.

Create a compressed tar file with all your .diff, plus the
<program_language.ts> files and submit them to the mythtv developer list
(myth-dev at snowman.net). tar syntax is:

$ tar zcvf <file_to_be_created>.tar.gz <file1...> <file2...>

Note about colorized EPG:
To colorize the EPG accoirdingly to the listed categories in your country,
you might want also setup a color for each category at the ui.xml of each
theme that you would like use.
Personally I want to think on this:  (2 EPG * Languages * Possible
Categories * themes) = hundreds, if not thousands.

Maybe someone can review this (i'm not native english) or clarify some
points. In the meantime, I guess that's a good start for those who wish to
add a new language and therefore help to make the mythtv user community
larger ;-)


----- Original Message -----
From: "Peter" <l-case at gmx.net>
To: <mythtv-dev at snowman.net>
Sent: Friday, May 16, 2003 4:43 PM
Subject: [mythtv] i18n german

> Hello,
> can someone point me how i can make a german translation for the xml
> Perhaps it would nice to make an general doc how to make a translation for
> mythtv :) so every user can contribute his language.
> Bye Peter
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev

More information about the mythtv-dev mailing list