Currently Online

Latest Posts

Topic: Changing text without loosing translations

alocritani
Joined: 2011-11-24, 13:03
Posts: 55
Ranking
Likes to be here
Location: Trento, Italy
Posted at: 2012-01-05, 10:08

I'm trying to understand how the translation stuff works.

According to my current knowledge the situation is the following:

  • strings are marked in source file in a special way ie: _("String")
  • using utils/buildcat.py these translatable strings are compiled into a catalog (.pot file)
  • .pot (and .po) files are taken from trunk and imported by Launchpad
  • translators translate the strings and output go to .po file
  • .po files are exported by Launchpad in "Translations" branch
  • translations branch is then merged into trunk at regular intervals
  • using make lang .po are compiled into .mo - actual files used by the software.

The main obscure part (at least for me) is what happen in Launchpad.

According to https://help.launchpad.net/Translations/YourProject/ImportingTranslations

it seems that .pot and .po files are imported and priority is given to translations existing in Launchpad except in 2 cases.

The first time that the translation of a string, in a particular language, is imported into Launchpad, it will take precedence over any existing translation made in that language in Launchpad.

I don't understand the previous point: if the translation is new, over what is taking precedence? Or does it means that the translations is simply imported and added to Launchpad?

If an imported string matches the translation already made in Launchpad. This means that the translation will now be overwritten by any subsequent imports, if they differ. However, making a change to the translation in Launchpad would reset it to take precedence over imported strings.

Does this condition happen only if you merged "translations" branch into trunk?


The reason I'm asking that is because I found that words "pitta bread" identify what in English should be called "pita" (only one 't' and maybe without bread). So I've tried changing it but found that these words are used in scenarios' texts also.

I'm looking for a way to change it without loosing translations.

So my idea, if all the above is correct, is

  • to update catalogs and merge back translations to trunk in order to obtain the updated .po files.
  • change the English text in all .po files, changing "pitta bread" into "pita".
  • when Launchpad will import .po and .pot files, should find the "new" string (containing "pita") and also its translation in the imported .po files.

Should it work? Does another way exist?

Thanks

edit: just realized that maybe it be in "translation" forum. Please, if it is the case, move it.

Edited: 2012-01-05, 10:12

Top Quote
Nasenbaer
Avatar
Joined: 2009-02-21, 18:17
Posts: 829
Ranking
One Elder of Players
Location: Germany
Posted at: 2012-01-05, 10:46

Normally there is another way: When you do not use launchpad for translation (as we did before our move to launchpad) gettext marks changed original strings with previously existing translations as "fuzzy" - so to say as "check if still valid" - translators had just to check those translations and everything was fine - no translation was lost. But launchpad works differently - if a string was changed (even just a point added to a long sentence), all old translations are removed... for me still a big minus for launchpad

Your example is one of those I do not see such a big problem with - it's just one word, retranslating it is not such a big problem. However: fixing a typo in one of the (often more than 100 words long) campaign strings will remove all existing translations as well - and HERE is the point why launchpads behaviour is a big minus.

Well... sorry... actually I am not able to solve your problem, but at least I can tell you why it should NOT be a problem, but simply is because of launchpad face-sad.png


Top Quote
alocritani
Joined: 2011-11-24, 13:03
Posts: 55
Ranking
Likes to be here
Location: Trento, Italy
Posted at: 2012-01-05, 11:00

Nasenbaer wrote:

Your example is one of those I do not see such a big problem with - it's just one word, retranslating it is not such a big problem. However: fixing a typo in one of the (often more than 100 words long) campaign strings will remove all existing translations as well - and HERE is the point why launchpads behaviour is a big minus.

Unluckily, the "Pitta Bread" word is used in some scenario and it's used inside long sentences.

Maybe wares'/buildings' names should be used in a separate string in scenarios, like:

"You should build also a " + _"Lumberjack's hut" + _"to provide more wood"

instead of

"You should build also a Lumberjack's hut to provide more wood"

In this way changing wares' or buildings' names won't impact on translations.

I know about gettext's fuzzy strings, so that's why I'm a bit confused about how to manage them in Launchpad (no way at the moment).


Top Quote
SirVer
Joined: 2009-02-19, 15:18
Posts: 1439
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2012-01-05, 11:03

alocritani: the internals of launchpad are a mystery to us as well. It is all open source, so one could just take a look. Otherwise your bullet point list is correct. About the pitta bread - I disagree here: This is pitta bread made by the barbarians - A fictional thing made in a fictional world by a fictional tribe. It is written "pitta bread" because we choose so. There is something similar in the real world called pita. Those things are not related. I am therefore against "fixing" the wording.

Nasenbaer: I agree that loosing translations on every change is a huge PITA and a real downside of launchpad translations. Also, the web UI is not really easy to use. Otoh before that, people needed to be technically inclined to translate and we had significantly less translators who actually got some work done. I recommend pushing the launchpad crew via their bug tracker to get this fixed as often as you can.


Top Quote
alocritani
Joined: 2011-11-24, 13:03
Posts: 55
Ranking
Likes to be here
Location: Trento, Italy
Posted at: 2012-01-05, 11:09

SirVer wrote: About the pitta bread - I disagree here: This is pitta bread made by the barbarians - A fictional thing made in a fictional world by a fictional tribe. It is written "pitta bread" because we choose so. There is something similar in the real world called pita. Those things are not related. I am therefore against "fixing" the wording.

Thanks for clarification, Sirver. The "pitta problem" hit me (and italian translators) when thinking about how to translate it. We thought it was a (misspelled) pita so that's the reason for the proposal correction.

Can we consider a "pitta" to be similar to a "pita" for translation? Or do you suggest to keep the "pitta" name invariant in our language?


Top Quote
alocritani
Joined: 2011-11-24, 13:03
Posts: 55
Ranking
Likes to be here
Location: Trento, Italy
Posted at: 2012-01-05, 11:19

SirVer wrote:

Nasenbaer: I agree that loosing translations on every change is a huge PITA and a real downside of launchpad translations. Also, the web UI is not really easy to use. Otoh before that, people needed to be technically inclined to translate and we had significantly less translators who actually got some work done. I recommend pushing the launchpad crew via their bug tracker to get this fixed as often as you can.

just a quick search and I found

https://answers.launchpad.net/launchpad/+question/167923

https://bugs.launchpad.net/launchpad/+bug/493084

it seems that the support for fuzzy was removed by purpose.


offtopic: I really like the OpenTTD approach to translations, using a (I think) home-made web translator (http://translator.openttd.org/en/status). I think it supports fuzzy (not 100% sure, anyway).

note: this is not a proposal against launchpad - only a notice about how others are managing translations

Edited: 2012-01-05, 11:19

Top Quote