[Sugar-devel] Automagical regeneration of POT files in Git (and Poolte)

Aleksey Lim alsroot at activitycentral.org
Sun Aug 14 08:46:26 EDT 2011


On Fri, Aug 12, 2011 at 02:11:56PM -0400, Chris Leonard wrote:
> 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)

Notes reading the sources code of pogenerator.py..

> 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.

The entirely section name (in square brackets) is, looks like reading
the source code, just a full path to the .pot file.

> 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.

PROJECT_NAME_AS_IN_GIT_PATH from the .ini file is being used only for
logging

> 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.

yup, bundlebuilder is for activities and intltool for intltool based
projects like glucose

-- 
Aleksey


More information about the Sugar-devel mailing list