[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] Splitting D-I translation in "sublevels": ready infrastructure



Quoting Frans Pop (elendil@planet.nl):
> On Monday 31 December 2007, Christian Perrier wrote:
> > Before I activate this feature, I wanted to give you people
> > opportunities to react and bring input.
> 
> It's on my ToDo list, but I've been giving partman work priority.
> 
> Could you describe where exactly to find the new scripts and give an 
> overview how the new l10n sync procedure looks (merge, update, split, 
> commit sequences)?

First elements:

The script is scripts/l10n/l10n-sync, the same one that's used right
now.

As long as the "--split" switch isn't used, the behaviour is the
current one: 1 big master file.

If "--split" is used, it needs to be given a number of sublevels:
"--split=5" for instance.


In short, the process is the following:

- initialize variables

- command-line parsing

- initialize a few more variables, depending on command-line sitches

- sanity checks

- loop over packages and "svn up" then "debconf-updatepo" for each
  (lines 325-385)

- built ONE big templates.pot file
  (lines 487-430)

- create the N sublevel templates.pot files. The key command is
"msggrep", line 441. It greps for "# :slx:" where "x" is the sublevel number
  (lines 432-459)
  If a string isn't marked, it ends up in sublevel 1 (line 458)


- depending on whether "--split" is used or not:
  (lines 461 to 601)

  - sync packages/po/*.po with packages/po/templates.pot

  - for each sublevel, sync packages/po/sublevel$i/*.po with 
    the respective templates.pot files AND grab translations from
    lower level files (this allows identical strings to always get
    the same translations across sublevels)

- if sublevels are used, rebuild "master" files for each language
  in packages/po. These will not be committed.
  (lines 603-620)

- for all packages, update debian/po/*.po from the single master file
  (620-end)
  That part has indeed now changed

The tricky parts are then indeed:

- creation of the multiple templates.pot files. Involves using msggrep

- syncing high sublevel files with lower sublevel files, allowing
  identical strings to get identical translations

- the rebuild of a single "master" file even when using sublevel
files. This is indeed meant to speed up the process a lot as,
otherwise, each PO file for each package would need to be synced with
N different master files, which is very time consuming/
 


> 
> > So, again, feel free to comment. I plan to activate this feature as of
> > next week-end (5 or 6th January).
> 
> I'd appreciate it if you'd wait until I have actually reviewed it.

No problem.

> 
> There's at least one things I have my doubts about: the fact that strings 
> can be in multiple sublevels. IMO that is bound to cause problems at some 
> point and it should be possible to filter that out.


Well, the key has been to decide that the lower sublevel will then get
priority. So, if translators start with these sublevels, these strings
will already be translated in higher sublevels when they'll come on
these.



Indeed, there haven't been that many changes to the sync script to
implement this.

You'll also notice that the number of sublevels is not harcoded. We
can decide to have more...or less at some moment.


Attachment: signature.asc
Description: Digital signature


Reply to: