Page 1 of 1

How to test your translation (obsolete)

Posted: Wed May 06, 2009 10:13 am
by clem
Edit: Translations have moved to Launchpad. The content below is now obsolete.

There's nothing better than testing your own translation, i.e. running the software you just translated with your own brand new translation. And that's actually very easy to do.

Let's say we're translating mintDesktop in Spanish..

Create the folder:

The first step is to create a new folder for Spanish translations in mintDesktop (if it doesn't exist already).

- Open a terminal and type:

Code: Select all

sudo mkdir -p /usr/lib/linuxmint/mintDesktop/locale/es/LC_MESSAGES
Note: "es" stands for "Spanish", so replace this appropriately ("it" for Italian.. etc etc..).

Create the PO file:

The second step is to create the translation file in the right place:

- In the terminal type:

Code: Select all

gksu gedit /usr/lib/linuxmint/mintDesktop/locale/es/LC_MESSAGES/messages.po
- Then paste the content of your translation:
msgid "Desktop Items"
msgstr "Icônes sur le bureau"

msgid "Computer"
msgstr "Poste de travail"

msgid "Home"
msgstr "Dossier personnel"

msgid "Network"
msgstr "Serveurs réseaux"

msgid "Trash"
msgstr "Corbeille"

msgid "Mounted Volumes"
msgstr "Volumes de stockage"
Note: That's supposed to be Spanish.. but I'm not that good at Spanish so the example above is actually French.. just don't mind that too much :)

Compile the translation:

- In a terminal, type:

Code: Select all

apt install gettext

Code: Select all

cd /usr/lib/linuxmint/mintDesktop/locale/es/LC_MESSAGES

Code: Select all

sudo msgfmt messages.po
Test your application:

- In a terminal, type:

Code: Select all

LANGUAGE=es mintdesktop
- Check that everything is in Spanish.

- Eventually reopen Gedit the same way as before, make extra modifications, recompile the file with msgfmt and rerun the application until you're fully happy with everything.

This example above was for mintDesktop and "es" (Spanish), it works in the exact same way for other languages and other mint tools.

Questions are welcome, don't hesitate to ask by replying to this thread.

Clem.

Re: How to test your translation

Posted: Mon May 11, 2009 11:04 am
by kvaju
locale es stands for spanish, what shortcut is for Croatian? cr? hr? or there is some rule?

thanks

Re: How to test your translation

Posted: Mon May 11, 2009 12:21 pm
by emorrp1
I found the following list of acronyms: http://www.zenphoto.org/svn/trunk/zp-co ... s-i18n.php
Croatian is hr.

Re: How to test your translation

Posted: Wed May 13, 2009 4:50 am
by clem
Another way to know that is to look in Synaptic for "Croatian" and you'll see packages like language-pack-hr

Clem

Re: How to test your translation

Posted: Thu May 14, 2009 11:11 am
by emorrp1
abhilashkumar: try the command in all lowercase as in the mintDesktop example clem gives above. mintBackup is strange in that it provides both a lowercase version and a camelCase version. To be sure, you can see a list of all the mint commands by typing "mint" and hitting tab twice in the terminal.

Re: How to test your translation

Posted: Thu May 14, 2009 11:58 am
by emorrp1
Are you by any chance running mint 6 felicia? You can only really test the Gloria translations with the Gloria versions of the mintTools, which you get by installing Gloria. Nevertheless, you can still test the translations to a certain extent e.g. spanish mintUpload (and it should be similar for some other mintTools too:

Code: Select all

LANGUAGE=es /usr/lib/linuxmint/mintUpload/mintUpload.py