[QGIS-Developer] translate plugin gui and log messages

matteo matteo.ghetta at gmail.com
Mon Jun 24 01:37:24 PDT 2019


Hi Calvin,

> This seemed to work, but I have a question about translation. I first
> created the english .ts file. I assume that someone then does a
> translation of that file, but I notice in the XML that it has it tied to
> a line number. What happens when I make a change to the code and the
> line number changes? How is this all managed?

that is he job of the update_strings.sh script (at least, I think so).

Basically when you update something (code withing the self.tr() function
or UI), you should run the update_strings.sh script so that the old
string will stay translate and untouched while the new ones (or the
updated ones) will be available for translation.

The script can be run with make transup.

So the workflow should be:

* make transup
* translate
* make transcompile

updates in your plugin? Run the same commands again

BTW: you can mix this with transifex to mangage the translations only in
tx and pulling/pushing the strings from there.

Cheers

Matteo


More information about the QGIS-Developer mailing list