[Sugar-devel] Automagical regeneration of POT files in Git (and Poolte)
Chris Leonard
cjlhomeaddress at gmail.com
Fri Aug 12 14:11:56 EDT 2011
All,
As mentioned in an earlier message to this list, we are looking at
re-establishing the auto-magical regeneration of POT files that had
left developers with the belief that "Pootle" took care of that, when
in fact it was some scripts Sayamindu had cooked up and had/has
running as a cron job (Rafael now owns this cron job and the repos
cited below).
I decided to send this to the sugar-devel list instead of handling it
all in private messages because:
1) More eyes might spot more issues.
2) This is a "learning by doing and sharing" kind of crowd, so it
seemed appropriate that we all learn a little something about our i18n
processes together.
Please understand that I am still trying to figure this stuff out
myself. Like everyone else here, I have long treated the back-end of
Poolte-git connections as a form of dread black magic that only
Sayamindu could handle safely. I'm also not a Python coder, so some
of my uncertainties may seem naive to those of you who are (e.g.
understanding exactly how the .ini file is used by the pogenerator.py
script), so you'll have to be a little indulgent of my ignorance and
for my attempts to "learn out loud".
The relevant code and .ini files are:
http://git.sugarlabs.org/pootle-helpers/mainline/blobs/master/potupdater/pogenerator.py
and
http://git.sugarlabs.org/pootle-helpers/mainline/blobs/master/potupdater/project_list.ini
possibly including:
http://git.sugarlabs.org/pootle-helpers/mainline/blobs/master/potupdater/find_new_pots.py
The first step is to parse the potupdater_project.ini file format. A
pseudo-example is shown below. The ALLCAPS stuff is the variable
portion and my guesses at the proper substitutions are shown below. I
also include some comments about where my areas of uncertainty are.
The file consists of many repeating units in the following general
formula.
[/var/lib/pootle/checkouts/POOTLEPROJECTNAME/PO_NAME_AS_IN_POOTLE/po/POT_NAME_AS_IN_GIT.pot]
project = PROJECT_NAME_AS_IN_GIT_PATH (master)
vcs = git
method = METHOD
layout = gnu
POOTLEPROJECTNAME options
glucose
frucose
honey
glucose92
update1 (deprecated)
glucose82 (deprecated)
fructose82 (deprecated)
glucose84 (deprecated)
fructose84 (deprecated)
I'm 100% sure this is the right way to parse the POOTLEPROJECTNAME field.
PO_NAME_AS_IN_POOTLE is the name as it appears in Pootle without the
.po extension.
I'm much less 100% sure if this needs to be standardized at all, but
I'm wondering how else the script would know which PO file in Pootle
was being referenced.
POT_NAME_AS_IN_GIT.pot is the POT name exactly as it appears in the
git /po directory.
PROJECT_NAME_AS_IN_GIT_PATH
example from below would be "story-builder-branch"
http://git.sugarlabs.org/story-builder-branch/mainline/trees/master
I've made many changes form Uppercase to lower case in this field and
a few changes to include "-branch".
I have a reasonable certainty that this is the right way to parse the
PROJECT_NAME_AS_IN_GIT_PATH field. it is always possible that a
different version of the project Name (say the one that prints as the
title of the page) is what is needed here, so this needs to be
confirmed in detail.
METHOD options
intltool for Glucose (and versions thereof)
bundlebuilder for Fructose and Honey
I'm 100% sure this is the right way to parse the METHOD field.
________
I may have some of the details of the substitutions incorrect, so any
confirmation that can be provided would be welcome.
In reviewing the existing .ini file, I see any number of cases where I
infer that the format is not correct (at present). I think a lot of
this may have come from an incomplete conversion from primarily
pointing at the OLPC dev.laptop.org repo (on an OLPC hosted Pootle
instance) to primarily pointing at the Sugar Labs git.sugarlabs.org
repo (on a Sugar Labs hosted Pootle instance).
I've attached a heavily modified and reordered version of the .ini
file based on my guesses and assumptions. The ordering I used is
based on listing order in Pootle. I do not believe it is ready for
use without serious review and discussion. There are also some corner
cases that need to be resolved, but I won't go into those in this
message, maybe later.
This is a part of a Pootle restoration project that Rafael and I have
been working on and Aleksey has been contributing as well. My intent
is sending this to the list is invite other contributors to review and
decipher the mysteries of Pootle-git interactions as well as to shed
some light on a topic that has been subject to much speculation, but
too little introspection.
Warmest Regards,
cjl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cjl_potupdater_project_list.ini
Type: text/x-ini
Size: 15164 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110812/03940a09/attachment-0001.bin>
More information about the Sugar-devel
mailing list