← Back to team overview

openerp-expert-localization team mailing list archive

Re: Changing English strings without losing translations

 

A Dimarts, 16 de febrer de 2010, Équipe informatique va escriure:
> Dear l10n experts,
> In the IRC meeting last friday, I expressed my concerns with the current
> state of English strings in OpenERP.
> A lot of strings should still be fixed or clarified, but we must try to
> keep the existing translations as much as possible.
> Does anyone have an idea of how we can change the English strings in the
> source code, and still keep most of the translations?
> GNU gettext has a feature called "fuzzy strings" to adresse this, but
> Launchpad doesn't support this and this is not top priority for them -
> see https://blueprints.launchpad.net/rosetta/+spec/rosetta-fuzzy-merge .
> Any idea?

In the case of strings that come from the sources and marked with _() it could 
be possible to solve many cases by using information in .po files that stores 
*where* the string came from (that is file name and line number). I suggest 
you to take a look at polib which is a library to read and write .po and .mo 
files for python (which surprisingly OpenERP is not using).

In cases where the original text changed only to fix a small spelling error, 
using Levenshtein (or some other string comparison algorithm/library) could 
help too.

[thinks a bit]

Maybe one idea would be something like this:
- Given a module fix all strings from .py files, reports, etc.
- Create a script that tries to match all new entries with previous ones using 
the methods suggested above, maybe using files diffs, etc.
- Let the user (the one who's fixing those strings) validate the output of the 
script and modify all matches that where not computed correctly.
- Once the user validates the list of matches update all .po files for all 
languages replacing old strings with the new ones (using polib it's damn 
easy).


> Yours,
> Lionel.
> 


-- 
Albert Cervera i Areny
http://www.NaN-tic.com
Mòbil: +34 669 40 40 18



Follow ups

References