Welcome, Guest! Log In | Create Account

Translating SMPlayer

From smplayer

Jump to: navigation, search


How to translate SMPlayer in your language


1. Download the software "Linguist"

  • Windows : [1]
  • Linux : It should be in qt-devel, libqt-dev (or similar) or in its own package (maybe as qt-linguist)

Documentation's here.

2. How "Linguist" works

Now that you have the software, run it, and open one of the *.ts files included in the source code of smplayer or in the svn, for instance smplayer_es.ts. You have this window:

You 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 have to press Ctrl+Enter in every translation to check it as "done" (it appears with a green check mark). Phrases not marked as "done" appear with a yellow question mark, and the translation aren't 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. You can also upload it directly to the svn.

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.