[Sugar-devel] Localization in web activities

Sam P. sam.parkinson3 at gmail.com
Fri Apr 17 18:36:31 EDT 2015


I might just put in my 2c of how I do it with the new ASLO.

I have a script [1] that regexes through my code to find where I have put
strings for translation to make a POT file.  I then have a hacky script [2]
that regexes though the PO files to convert them to JSON.  It works pretty
OK I think.

Thanks,
Sam

[1]  https://github.com/SAMdroid-apps/aslo/blob/master/web/genpot.py
[2]
https://github.com/SAMdroid-apps/aslo/blob/master/web/preprocessor/po_to_json.py

On Sat, Apr 18, 2015 at 5:31 AM Gonzalo Odiard <godiard at sugarlabs.org>
wrote:

> If you can generate a standard .pot file with your scripts,
> that can be consumed by pootle, and in pootle can be created the .po files.
> Then you can fill your localization.ini file with the po files with
> another script.
> There are a library named polib [1] in python that allow manipulate
> .po/pot files easily.
> like here [2]
>
> Gonzalo
>
> [1] https://pypi.python.org/pypi/polib
> [2]
> https://github.com/godiard/help-activity/blob/master/tools/seed_translation.py
>
>
>
> On Fri, Apr 17, 2015 at 4:17 PM, Walter Bender <walter.bender at gmail.com>
> wrote:
>
>> I am maintaining the po files in tutrlejs by hand (and a few custom
>> scripts). I use them to then generate a localization.ini file (with a
>> script Ignacio wrote for GCI). We don't have Pootle integration yet.
>>
>> I can try to make my scripts more general pupose... need advice as to
>> how to communicate with Pootle.
>>
>> -walter
>>
>> On Fri, Apr 17, 2015 at 2:27 PM, Gonzalo Odiard <godiard at sugarlabs.org>
>> wrote:
>> > Hi Walter, Lionel and Martin:
>> >
>> > I have a doubt. How is done localization inthe web activities?
>> > Can we use translate.sugarlabs.org to translate them?
>> > There are a request to add a new web activity to the server [1],
>> > but I don't remember we had a mechanism to create pot files from js,
>> > or integrate the po translations later.
>> > I see po files in turteartjs, but I don't know if are used at all.
>> >
>> > --
>> > Gonzalo Odiard
>> >
>> > SugarLabs - Software for children learning
>> >
>> > [1] http://bugs.sugarlabs.org/ticket/4839
>>
>>
>>
>> --
>> Walter Bender
>> Sugar Labs
>> http://www.sugarlabs.org
>>
>
>
>
> --
> Gonzalo Odiard
>
> SugarLabs - Software for children learning
>  _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20150417/4f54a6fc/attachment-0001.html>


More information about the Sugar-devel mailing list