Re: Translating docs on l10n status page



In the pt_BR team, we used xml2po to split the message catalog in
chapters, and later merged the partial translations. I don't believe
we could have translated it without that.

The following scripts illustrate how I managed it:

First, save this in chapter-list.txt:

==8<===
../C/user-guide.xml
../C/gosbasic.xml
../C/gosoverview.xml
../C/gosstartsession.xml
../C/gospanel.xml
../C/goseditmainmenu.xml
../C/gosnautilus.xml
../C/gostools.xml
../C/goscustdesk.xml
../C/glossary.xml
../C/gosfeedback.xml
../C/legal.xml
==8<===

Now, the scripts. They are supposed to be run inside
gnome-user-docs/gnome2-user-guide/ab_CD. They should work with other
docs (admin, a11y), but naturally the chapter-list.txt content will
vary.

==8<===
#!/bin/sh
#
# Splitting the catalog in chapters
#

svn update ..

while read chapterfile; do
  chapter=$(basename $chapterfile .xml)
  xml2po -p ${chapter}.pot $chapterfile
  msgmerge ab_CD.po ${chapter}.pot > ${chapter}.HEAD.ab_CD.po
done < chapter-list.txt

==8<===

==8<===
#!/bin/sh
#
# Joining the chapters in the catalog
#

svn update ..

cat chapter-list.txt | xargs xml2po -o user-guide.pot

for catalog in *.HEAD.ab_CD.po; do
  # First, we must delete obsolete translations. Really.
  # Else, fuzzy translations in the catalog will override the good
ones in ab_CD.po
  sed -i "/^#~/d" $catalog
  # Some messages exist in more than one chapter. You must fix any inconsistency
  # before merging the translations. Else, the last files will
override the first ones.
  msgmerge --update $catalog user-guide.pot --compendium=ab_CD.po
  mv $catalog ab_CD.po
done

==8<===

Of course, the latter script is very dangerous. This aren't exactly
the scripts I used, because part of my work was manual. Please test
them first with a copy of the translations! In real life, the chapter
translations will be delivered on at a time, so one might prefer this
script:

==8<===
#!/bin/sh
#
# Join a chapter translation to the message catalog
#
# Syntax: my-script-name chapter-name.HEAD.ab_CD.po
#

svn update ..
cat chapter-list.txt | xargs xml2po -o user-guide.pot
msgmerge --update $1 user-guide.pot --compendium=ab_CD.po
mv $1 ab_CD.po

==8<===

You might want to alter the script so that it won't delete the
original catalogs.

I hope this can help the other teams (including mine, which has two
untranslated guides left).

Leonardo Fontenelle
http://leonardof.org

2007/6/28, Clytie Siddall <clytie riverland net au>:
> Hi everyone :)
>
> I have only just returned to i18n after several months unable to
> contribute, so sorry if this is a dumb q. (Not my first for today,
> either. <blush>)
>
> Looking at the Damned Lies l10n status pages, excellent tools that
> they are (e.g. [1]), this evening I translated the docs file for the
> Workspace Switcher Applet ... only to find in its text that the doc
> was deprecated, and the current info was in the User Guide.
>
> So I have two questions:
>
> Should we translators be concentrating our doc-translation resources
> upon the User Guide itself, instead of on the individual files listed
> on our status pages? (Sub-question: Should the other files be there
> at all?)
>
> If so, would it be possible to break the enormous User Guide up into
> similar individual files (chapters?) ? Its current size is
> intimidating: you would get a lot more translations contributed if we
> could do it in sections.
>
> Thankyou for sharing your knowledge and experience. :)
>
> from Clytie (vi-VN, Vietnamese free-software translation team / nhóm
> Việt hóa phần mềm tự do)
> http://groups-beta.google.com/group/vi-VN
>
> [1] http://l10n.gnome.org/languages/vi/gnome-2-20
>
>
>
> _______________________________________________
> gnome-doc-list mailing list
> gnome-doc-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-doc-list
>
>
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]