[Sugar-devel] Translating etoys home screen

Chris Leonard cjlhomeaddress at gmail.com
Wed Oct 9 11:31:01 EDT 2013


The POT in the zip has been uploaded to Templates and propagated across langs.

Project-Home.pot

The following langs have been populated with the provided strings:

de, es, fr, ja, pt, pt_BR, zh_CN

I will also do the three English variants (en, en_US, en_GB).

So at least now there is a means of capturing the strings in Pootle
via translating the Project-Home.po for a given language. Building the
.pr is left as a manual process for the moment.

Daniel, ask the Armenian team translate these few words:

http://translate.sugarlabs.org/hy/etoys_new/

On Wed, Oct 9, 2013 at 7:52 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On 09.10.2013, at 12:31, Chris Leonard <cjlhomeaddress at gmail.com> wrote:
>
>> Bert,
>>
>> Would this POT capture everything that is needed?
>>
>> I can add it to Templates in Etoys and propagate it across langs.
>>
>> If you set it up in an SVN directory, we could even work on pushing it
>> to your repo, in the meantime, it would at least be in Pootle.
>
>
> I'm attaching a zip resulting from running the snippet below which exports all translated strings from a project. In theory that could be used to automate project translations in the future. And if someone makes the gallery and tutorial projects translatable (by turning on the "translatable" property on the right strings and providing one translation at least) we could use the snippet to gather those strings, too.
>
> - Bert -
>
> | original translations msgids msgid msgstr ext |
> original := LocaleID isoString: 'en'.
> translations := Dictionary new.
> msgids := Dictionary new.
> World allMorphs do: [:m | (m isTextMorph and: [m translatable]) ifTrue: [
>         msgid := (m translations at: original) asString.
>         msgids at: m externalName put: msgid.
>         m translations keysAndValuesDo: [:k :v |
>                 (translations at: k ifAbsentPut: [Dictionary new])
>                         at: msgid put: v asString]]].
> translations keysAndValuesDo: [:locale :trans |
>         ext := locale = original ifTrue: ['.pot'] ifFalse: ['-', locale asString,'.po'].
>         FileStream fileNamed: 'Project-', Project current name, ext do: [:f |
>                 f lineEndConvention: #lf.
>                 msgids keys asSortedCollection do: [:name |
>                         msgid := msgids at: name.
>                         msgstr := trans at: msgid.
>                         locale = original ifTrue: [msgstr := ''].
>                         f nextPutAll: '#: ', Project current name, '.pr ', name; cr.
>                         f nextPutAll: 'msgid "', (msgid copyReplaceAll: String cr with: '\n'), '"'; cr.
>                         f nextPutAll: 'msgstr "', (msgstr copyReplaceAll: String cr with: '\n'), '"'; cr.
>                         f cr.]]]
>


More information about the Sugar-devel mailing list