Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patch-locale.py

0 views
Skip to first unread message

Tim Babych

unread,
Jul 17, 2008, 11:13:08 AM7/17/08
to
Hello All.

I have written a simple script to ease merging changes into existing
l10n. It takes output of Axel's compare-locales and then modifies your
files accordingly. Removes obsolete lines and files and adds missing
ones.

The usage is simple:
./patch-locale.py reference_dir l10n_dir

And that is it.

When adding new lines the script writes FIXME before them so you can
easily find those untranslated lines later. It helps to get your
localization back on green so you can test partly-translated work.

Installation:
* install compare-locales (http://developer.mozilla.org/en/docs/
Compare-locales), I tested with version 0.4.23
* grab http://clear.com.ua/misc/patch-locale.py

--
yours, Tim

Axel Hecht

unread,
Jul 17, 2008, 12:35:35 PM7/17/08
to

Hi Tim,

I think I can spot bugs :-/.

<!ENTITY stress.test "This is a notorious
unneeded
entity
entry
with more than one line.">

There are some files where order matters, too, sadly.

I'm currently working on a whacking of compare-locales, not sure if
that's going to impact your stuff. Possibly not. But the whole "get the
app directories" stuff will change for 3.1. And it's currently able to
merge out of band, which is interesting for build, but not for actual
localization.

Anyway, any kind of merge based on my lib is likely going to be rather
ad-hoc, gandalf is working on some interesting alternative. It's based
on a more powerful lib, but might be slower, and is currently trickier
to use in your own scripts. Anyway, I'll leave it up to him to blog or
post about that.

Axel

Tim Babych

unread,
Jul 18, 2008, 11:58:57 AM7/18/08
to
On Jul 17, 7:35 pm, Axel Hecht <l...@mozilla.com> wrote:
> Tim Babych wrote:
> > Hello All.
>
> > I have written a simple script to ease merging changes into existing
> > l10n. It takes output of Axel's compare-locales and then modifies your
> > files accordingly. Removes obsolete lines and files and adds missing
> > ones.
>
> > The usage is simple:
> > ./patch-locale.py reference_dir l10n_dir
>
> > And that is it.
>
> > When adding new lines the script writes FIXME before them so you can
> > easily find those untranslated lines later. It helps to get your
> > localization back on green so you can test partly-translated work.
>
> > Installation:
> > * install compare-locales (http://developer.mozilla.org/en/docs/
> > Compare-locales), I tested with version 0.4.23
> > * grabhttp://clear.com.ua/misc/patch-locale.py

>
> Hi Tim,
>
> I think I can spot bugs :-/.
>
> <!ENTITY stress.test "This is a notorious
> unneeded
> entity
> entry
> with more than one line.">
>
> There are some files where order matters, too, sadly.

I know, and other issue I am aware of is that it does not copy related
comments.
Through it is still useful for me and I thought it may help somebody
working on Sunbird these days.

> I'm currently working on a whacking of compare-locales, not sure if
> that's going to impact your stuff. Possibly not. But the whole "get the
> app directories" stuff will change for 3.1. And it's currently able to
> merge out of band, which is interesting for build, but not for actual
> localization.
>
> Anyway, any kind of merge based on my lib is likely going to be rather
> ad-hoc, gandalf is working on some interesting alternative. It's based
> on a more powerful lib, but might be slower, and is currently trickier
> to use in your own scripts. Anyway, I'll leave it up to him to blog or
> post about that.

Looking forward for that.

0 new messages