How to make translations
Posted: Wed Dec 23, 2009 3:00 pm
Would you like to see smplayer translated to your own language?
Making a translation is easy.
You need a tool called "Linguist".
In linux it should be in qt-devel, libqt-dev (or similar) or in its own package (maybe as qt-linguist).
In windows it's included in the Qt opensource edition. But this package is very large, about ~50 MB size (it includes all necessary to compile Qt applications).
To make things easier I created a small zip which contains Linguist only (~ 4 MB). You can get it .
This package doesn't include the documentation, but you can consult it on-line, .
Now run linguist, and open one of the *.ts files included in the source code of smplayer, for instance smplayer_es.ts.
You will see the original source text in English and the translated one. Just make the translation to your language.
But it's better to start with an an empty file. Currently the file smplayer_en_US.ts is empty, so you can start with it.
You'll have to press Ctrl+Enter in every translation to check it as "done" (it will appear with a green check mark). Phrases not marked as "done" will appear with a yellow question mark, and the translation won't be used.
Just remember to save it later with a different name. If you translate to italian, save it as smplayer_it.ts.
Two important things to know:
* Some strings have variables: %1, %2 and so on. Examples: "The file %1 already exists", "Copying %1 to %2".
Those variables will be replaced at runtime with a filename, a number or something else (you'll know from the context). You may change the order of the variables if your language needs it.
* Accelerators: in some texts you will see something like this: "&Open". At runtime it will appear with the O underlined: Open. That means that the O key will be used as a key accelerator. But probably in your language the "open" word doesn't have a O. In Spanish for instance "open" is "abrir". So you will have to choose a new letter for the accelerator: &Abrir, but it can also be A&brir or Ab&rir, or whatever you want.
But you have to take care of not repeating the same accel for different options in the same menu (Linguist will warn you with a red exclamation mark)
Once you have finished the translation you'll probably want it to see in smplayer. In linguist select Open->Release and that will create a *.qm file. Copy it to wherever you have the smplayer executable and that's it.
The last step is to send me the translation (the *.ts file). I will add to the source code and your translation will available for everyone.
If you later want to update your translation, just get from time to time the smplayer sources, open the ts file in linguist and translate the new phrases.
Sending translations
You can send your translations to: smplayer.dev@gmail.com. When sending the ts file it should be uncompressed (no zip, no tar.gz...) and don't send the *.qm.
Making a translation is easy.
You need a tool called "Linguist".
In linux it should be in qt-devel, libqt-dev (or similar) or in its own package (maybe as qt-linguist).
In windows it's included in the Qt opensource edition. But this package is very large, about ~50 MB size (it includes all necessary to compile Qt applications).
To make things easier I created a small zip which contains Linguist only (~ 4 MB). You can get it .
This package doesn't include the documentation, but you can consult it on-line, .
Now run linguist, and open one of the *.ts files included in the source code of smplayer, for instance smplayer_es.ts.
You will see the original source text in English and the translated one. Just make the translation to your language.
But it's better to start with an an empty file. Currently the file smplayer_en_US.ts is empty, so you can start with it.
You'll have to press Ctrl+Enter in every translation to check it as "done" (it will appear with a green check mark). Phrases not marked as "done" will appear with a yellow question mark, and the translation won't be used.
Just remember to save it later with a different name. If you translate to italian, save it as smplayer_it.ts.
Two important things to know:
* Some strings have variables: %1, %2 and so on. Examples: "The file %1 already exists", "Copying %1 to %2".
Those variables will be replaced at runtime with a filename, a number or something else (you'll know from the context). You may change the order of the variables if your language needs it.
* Accelerators: in some texts you will see something like this: "&Open". At runtime it will appear with the O underlined: Open. That means that the O key will be used as a key accelerator. But probably in your language the "open" word doesn't have a O. In Spanish for instance "open" is "abrir". So you will have to choose a new letter for the accelerator: &Abrir, but it can also be A&brir or Ab&rir, or whatever you want.
But you have to take care of not repeating the same accel for different options in the same menu (Linguist will warn you with a red exclamation mark)
Once you have finished the translation you'll probably want it to see in smplayer. In linguist select Open->Release and that will create a *.qm file. Copy it to wherever you have the smplayer executable and that's it.
The last step is to send me the translation (the *.ts file). I will add to the source code and your translation will available for everyone.
If you later want to update your translation, just get from time to time the smplayer sources, open the ts file in linguist and translate the new phrases.
Sending translations
You can send your translations to: smplayer.dev@gmail.com. When sending the ts file it should be uncompressed (no zip, no tar.gz...) and don't send the *.qm.