[Localization] update-locale script
Jakub Ratajczak
jamarat at o2.pl
Tue Oct 25 18:43:00 EDT 2011
A non-text attachment was scrubbed...
Name: sugar-update-locale
Type: application/octet-stream
Size: 7129 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/localization/attachments/20111026/9a204243/attachment.obj>
-------------- next part --------------
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.
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
More information about the Localization
mailing list