[Qgis-developer] Translation changes

Magnus Homann magnus at homann.se
Fri Jan 18 07:50:27 EST 2008


I have been changing and cleaning up the text strings, to make it easier 
to translate. For translators, see more info below.

FOR DEVELOPERS:
There are a couple of things that I would like to point out:

* Do not use HTML-tags in .ui files. At least, not more than necessary. 
Qt Designer likes to add lots of style information in the .ui file, 
making it very hard to translate (see more below in the changeset):

* Store all settings (except of course names and such) in the project 
file in english. Use 'Green' instead of 'Grön' for colors selected by 
the users.

* For large text plates, consider using the constructor to populate the 
text plate, making it much easier to translate one sentence at a time, 
and decoupling layout strings from text strings. This also minimize 
translation of same string twice (e.g. 'Description' below)

* Take some time looking through your old stuff, maybe you can help?

**************
   // Set text for pyramid info box
   QString pyramidFormat("<h2>%1</h2><p>%2 %3 %4</p><b><font 
color='red'><p>%5</p><p>%6</p>");
   QString pyramidHeader    = tr("Description");
   QString pyramidSentence1 = tr("Large resolution raster layers can 
slow navigation in QGIS.");
   QString pyramidSentence2 = tr("By creating lower resolution copies of 
the data (pyramids) performance can be considerably improved as QGIS 
selects the most suitable resolution to use depending on the level of 
zoom.");
   QString pyramidSentence3 = tr("You must have write access in the 
directory where the original data is stored to build pyramids.");
   QString pyramidSentence4 = tr("Please note that building pyramids may 
alter the original data file and once created they cannot be removed!");
   QString pyramidSentence5 = tr("Please note that building pyramids 
could corrupt your image - always make a backup of your data first!");

 
tePyramidDescription->setHtml(pyramidFormat.arg(pyramidHeader).arg(pyramidSentence1)
			.arg(pyramidSentence2).arg(pyramidSentence3)
			.arg(pyramidSentence4).arg(pyramidSentence5));
**************

See also https://svn.qgis.org/trac/changeset/7997

FOR TRANSLATORS:

Yes, this means that some strings have to bre re-translated. That's the 
downside. On the upside, new translationa re much easier to perform, and 
small changes in large texts easier to discover and update.

I have used linguist on WinXP, and it keeps the old translation 
available in the GUI. By copying and pasting from the obsolete, large, 
HTM-infested translation one sentence at a time this was quite qick. I 
also disovered som errors in my translation. :-) An alternative could be 
having QGIS up and runinng with the old translation installed, and copy 
from there.

If no objections arise, I will continue clean up strings, but it is 
quite time-consuming, so it might take a long time before QGIS is 
totally clean, certainly not at string freeze in a few days.

-- 
Magnus Homann



More information about the Qgis-developer mailing list