[Localization] update-locale script

Walter Bender walter.bender at gmail.com
Tue Oct 25 19:56:51 EDT 2011


On Tue, Oct 25, 2011 at 7:39 PM, Walter Bender <walter.bender at gmail.com> wrote:
> On Tue, Oct 25, 2011 at 6:43 PM, Jakub Ratajczak <jamarat at o2.pl> wrote:
>>
>> Hi,
>> I got tired and frustrated with fighting with different locations for .mo files and updating them from pootle server. So I prepared script 'sugar-update-locale' to automate updating Sugar and its activities to the newest localized version. There is short info about the script below.
>> I think, there will be some upgrades of the script. I.e. some preinstalled activities (SoAS) like Clock or Abacus don't come with .mo files at all. It makes the script fool as it looks for existing .mo files.
>
> Huh? That is a bug. I'll investigate.

I just unzipped Abacus-26.xo and it has .mo files... What version were
you looking at?

  inflating: Abacus.activity/locale/yo/activity.linfo
  inflating: Abacus.activity/locale/yo/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/id/activity.linfo
  inflating: Abacus.activity/locale/id/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ja/activity.linfo
  inflating: Abacus.activity/locale/ja/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/rw/activity.linfo
  inflating: Abacus.activity/locale/rw/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tyv/activity.linfo
  inflating: Abacus.activity/locale/tyv/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/fa/activity.linfo
  inflating: Abacus.activity/locale/fa/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/dz/activity.linfo
  inflating: Abacus.activity/locale/dz/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/en_US/activity.linfo
  inflating: Abacus.activity/locale/en_US/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/es/activity.linfo
  inflating: Abacus.activity/locale/es/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pt/activity.linfo
  inflating: Abacus.activity/locale/pt/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ar_SY/activity.linfo
  inflating: Abacus.activity/locale/ar_SY/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/th/activity.linfo
  inflating: Abacus.activity/locale/th/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/bg/activity.linfo
  inflating: Abacus.activity/locale/bg/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/zh_HK/activity.linfo
  inflating: Abacus.activity/locale/zh_HK/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ml/activity.linfo
  inflating: Abacus.activity/locale/ml/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/si/activity.linfo
  inflating: Abacus.activity/locale/si/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/mg/activity.linfo
  inflating: Abacus.activity/locale/mg/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ms/activity.linfo
  inflating: Abacus.activity/locale/ms/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ro/activity.linfo
  inflating: Abacus.activity/locale/ro/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ht/activity.linfo
  inflating: Abacus.activity/locale/ht/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/mk/activity.linfo
  inflating: Abacus.activity/locale/mk/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ff/activity.linfo
  inflating: Abacus.activity/locale/ff/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/vi/activity.linfo
  inflating: Abacus.activity/locale/vi/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ak/activity.linfo
  inflating: Abacus.activity/locale/ak/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/it/activity.linfo
  inflating: Abacus.activity/locale/it/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/lv/activity.linfo
  inflating: Abacus.activity/locale/lv/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/is/activity.linfo
  inflating: Abacus.activity/locale/is/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tzo/activity.linfo
  inflating: Abacus.activity/locale/tzo/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pt_BR/activity.linfo
  inflating: Abacus.activity/locale/pt_BR/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/zh_CN/activity.linfo
  inflating: Abacus.activity/locale/zh_CN/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pis/activity.linfo
  inflating: Abacus.activity/locale/pis/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/na/activity.linfo
  inflating: Abacus.activity/locale/na/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/te/activity.linfo
  inflating: Abacus.activity/locale/te/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/el/activity.linfo
  inflating: Abacus.activity/locale/el/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sq/activity.linfo
  inflating: Abacus.activity/locale/sq/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/bn_IN/activity.linfo
  inflating: Abacus.activity/locale/bn_IN/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ur/activity.linfo
  inflating: Abacus.activity/locale/ur/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ta/activity.linfo
  inflating: Abacus.activity/locale/ta/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/fr/activity.linfo
  inflating: Abacus.activity/locale/fr/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/nn/activity.linfo
  inflating: Abacus.activity/locale/nn/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/nah/activity.linfo
  inflating: Abacus.activity/locale/nah/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/en/activity.linfo
  inflating: Abacus.activity/locale/en/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/mr/activity.linfo
  inflating: Abacus.activity/locale/mr/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/fa_AF/activity.linfo
  inflating: Abacus.activity/locale/fa_AF/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/son/activity.linfo
  inflating: Abacus.activity/locale/son/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/cs/activity.linfo
  inflating: Abacus.activity/locale/cs/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pl/activity.linfo
  inflating: Abacus.activity/locale/pl/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/he/activity.linfo
  inflating: Abacus.activity/locale/he/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/gu/activity.linfo
  inflating: Abacus.activity/locale/gu/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/bi/activity.linfo
  inflating: Abacus.activity/locale/bi/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/mvo/activity.linfo
  inflating: Abacus.activity/locale/mvo/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ps/activity.linfo
  inflating: Abacus.activity/locale/ps/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ar/activity.linfo
  inflating: Abacus.activity/locale/ar/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/uk/activity.linfo
  inflating: Abacus.activity/locale/uk/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/bs/activity.linfo
  inflating: Abacus.activity/locale/bs/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/fi/activity.linfo
  inflating: Abacus.activity/locale/fi/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sm/activity.linfo
  inflating: Abacus.activity/locale/sm/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pa/activity.linfo
  inflating: Abacus.activity/locale/pa/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sk/activity.linfo
  inflating: Abacus.activity/locale/sk/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tr/activity.linfo
  inflating: Abacus.activity/locale/tr/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/hy/activity.linfo
  inflating: Abacus.activity/locale/hy/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/da/activity.linfo
  inflating: Abacus.activity/locale/da/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/templates/activity.linfo
  inflating: Abacus.activity/locale/templates/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sw/activity.linfo
  inflating: Abacus.activity/locale/sw/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/nl/activity.linfo
  inflating: Abacus.activity/locale/nl/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/de/activity.linfo
  inflating: Abacus.activity/locale/de/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sr/activity.linfo
  inflating: Abacus.activity/locale/sr/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/st/activity.linfo
  inflating: Abacus.activity/locale/st/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/nb/activity.linfo
  inflating: Abacus.activity/locale/nb/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/qu/activity.linfo
  inflating: Abacus.activity/locale/qu/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/hus/activity.linfo
  inflating: Abacus.activity/locale/hus/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ha/activity.linfo
  inflating: Abacus.activity/locale/ha/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sd/activity.linfo
  inflating: Abacus.activity/locale/sd/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/lt/activity.linfo
  inflating: Abacus.activity/locale/lt/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tzm/activity.linfo
  inflating: Abacus.activity/locale/tzm/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ay/activity.linfo
  inflating: Abacus.activity/locale/ay/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/hi/activity.linfo
  inflating: Abacus.activity/locale/hi/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/kos/activity.linfo
  inflating: Abacus.activity/locale/kos/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tvl/activity.linfo
  inflating: Abacus.activity/locale/tvl/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/hu/activity.linfo
  inflating: Abacus.activity/locale/hu/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ku/activity.linfo
  inflating: Abacus.activity/locale/ku/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ig/activity.linfo
  inflating: Abacus.activity/locale/ig/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ko/activity.linfo
  inflating: Abacus.activity/locale/ko/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/mn/activity.linfo
  inflating: Abacus.activity/locale/mn/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sv/activity.linfo
  inflating: Abacus.activity/locale/sv/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/pap/activity.linfo
  inflating: Abacus.activity/locale/pap/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/af/activity.linfo
  inflating: Abacus.activity/locale/af/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/tpi/activity.linfo
  inflating: Abacus.activity/locale/tpi/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/zh_TW/activity.linfo
  inflating: Abacus.activity/locale/zh_TW/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/en_GB/activity.linfo
  inflating: Abacus.activity/locale/en_GB/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/km/activity.linfo
  inflating: Abacus.activity/locale/km/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/fil/activity.linfo
  inflating: Abacus.activity/locale/fil/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ton/activity.linfo
  inflating: Abacus.activity/locale/ton/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/cpp/activity.linfo
  inflating: Abacus.activity/locale/cpp/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ru/activity.linfo
  inflating: Abacus.activity/locale/ru/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/kn/activity.linfo
  inflating: Abacus.activity/locale/kn/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/am/activity.linfo
  inflating: Abacus.activity/locale/am/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/sl/activity.linfo
  inflating: Abacus.activity/locale/sl/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/wa/activity.linfo
  inflating: Abacus.activity/locale/wa/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ca/activity.linfo
  inflating: Abacus.activity/locale/ca/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ne/activity.linfo
  inflating: Abacus.activity/locale/ne/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/ug/activity.linfo
  inflating: Abacus.activity/locale/ug/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo
  inflating: Abacus.activity/locale/bn/activity.linfo
  inflating: Abacus.activity/locale/bn/LC_MESSAGES/org.sugarlabs.AbacusActivity.mo

>
> -walter
>
>>
>> BTW I stil don't see Polish language on the list of available languages on XO-1.5 11.20. Could you please help me with this? I didn't find any hint on Sugar wiki.
>> Best Regards,
>> Jakub
>>
>>
>> This script downloads the newest versions of localized strings for the
>> Sugar system and its activities:
>> - searches for all directories where sugar .mo files may exist
>>  (.mo files containing 'sugar' or 'olpc' or 'org.laptop' string)
>> - downloads .po files of requested language directly from the pootle
>>  server (default translate.sugarlabs.org), downloads .po files from
>>  'not-numbered' versions of projects (fructose, glucose)
>> - creates .mo files out of .po files with msgfmt tool
>> - stores .mo files in the appropriate direcotry (where .mo files should
>>  be stored)
>>
>> It is aimed to be used by developers and translators to keep them
>> up-to-date with the current localized version of the system.
>>
>> If you want to download files from 'numbered' versions of
>> fructose/glucose you may change the array within this script exchanging
>> fuctose -> fructose84 strings.
>> You should run this script as root.
>> You need have installed 'msgfmt' tool i.e. using 'yum install gettext'
>> (as root or sudo-ing).
>>
>> The script was tested on SoAS and XO-1.5 but should work on any Sugar.
>>
>>
>> sugar-update-locale version 0.1
>>  1) Getting help or info about ./sugar-update-locale :
>>  sugar-update-locale --help   Print this message
>>  sugar-update-locale --info   Print info about current configuration
>>  sugar-update-locale --list   Print the list of known .po/.mo files (known by this
>>              script - you are free to modify the list)
>>  sugar-update-locale --find   Searches for all directories where Sugar and its activities
>>              .mo files are installed
>>
>>  2) Running ./sugar-update-locale :
>>  sugar-update-locale [options]
>>  with following options (in that order)
>>  --pootle PootleURL  URL of the Pootle server (default
>>                      translate.sugarlabs.org)
>>  --lang LanguageISO  ISO code of the requested language
>>
>> Example:
>>  sugar-update-locale --lang pt
>>  Fetches Portugese language content from the default pootle server
>>
>>
>> _______________________________________________
>> Localization mailing list
>> Localization at lists.laptop.org
>> http://lists.laptop.org/listinfo/localization
>>
>>
>
>
>
> --
> Walter Bender
> Sugar Labs
> http://www.sugarlabs.org
>



-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org


More information about the Localization mailing list