Default Languages on Ubuntu iso for 12.10?
Steve Langasek
steve.langasek at ubuntu.com
Wed Sep 12 22:53:38 UTC 2012
On Wed, Sep 12, 2012 at 02:09:28PM -0500, Kate Stewart wrote:
> Looking at the current daily images,
> http://cdimage.ubuntu.com/daily-live/current/
> Now that feature freeze is passed, we may end up having some space to
> add some additional language packs back in, since we've made the
> decision to no longer restricted to the CD size.
> Is this the list that's historically been used to decide which ones
> to carry?
> http://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers
> or was other criteria involved? (am thinking of seb's comment at UDS
> for instance ;) )
The prioritized list is:
priority_langs = [ 'en', 'es', 'xh', 'pt', 'de', 'fr', 'bn', 'hi', 'ar', 'ru', 'zh', 'ja']
Historically the attached script is used for sizing in the lead-up to
release. I thought this script was in bzr somewhere, but my copy isn't from
a checkout and I can't find it anywhere else in a search. Maybe Martin has
one in bzr somewhere.
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek at ubuntu.com vorlon at debian.org
-------------- next part --------------
#!/usr/bin/env python
import warnings
warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
import apt, re, sys
apt_cache = apt.Cache()
# most spoken languages of the world, prioritized
priority_langs = [ 'en', 'es', 'xh', 'pt', 'de', 'fr', 'bn', 'hi', 'ar', 'ru',
'zh', 'ja']
# dependencies of scim* packages which are language specific (not already on
# ubuntu-desktop)
scim_extra_depends = {
# Japanese
'scim-anthy': set(['anthy', 'libanthy0']),
# Chinese
'scim-chewing': set(['libchewing3', 'libchewing3-data']),
'scim-pinyin': set(),
'scim-tables-zh': set(['scim-modules-table']),
# Korean
'scim-hangul': set(),
# various languages
'scim-tables-additional': set(['scim-modules-table']),
}
extra_pkgs_counted = {'gnome': set(), 'kde': set(), '(gnome|kde)': set()}
def language_size(lang, mode):
'''Return the cumulative size of all language packs related to the given
language code.'''
sum = 0
name_re = re.compile('^language-pack-(?:%s-)?%s(?:-|$)' % (mode, lang))
for p in apt_cache.keys():
if name_re.match(p):
sum += apt_cache[p].packageSize
if sum == 0:
raise Exception('Invalid language: %s' % lang)
# add required scim packages from language-support
if apt_cache.has_key('language-support-' + lang):
for d in apt_cache['language-support-' + lang].candidateDependencies:
dep = d.or_dependencies[0].name
if dep.startswith('scim') and dep not in extra_pkgs_counted[mode]:
sum += apt_cache[dep].packageSize
extra_pkgs_counted[mode].add(dep)
for extra_dep in scim_extra_depends[dep] - extra_pkgs_counted[mode]:
sum += apt_cache[extra_dep].packageSize
extra_pkgs_counted[mode].add(extra_dep)
return sum
def all_languages():
'''Return list of all available languages.'''
langs = []
for p in apt_cache.keys():
if p.startswith('language-pack-'):
comps = p.split('-')
if len(comps) == 3:
langs.append(comps[2])
return langs
def main():
# prioritize languages
langs = all_languages()
langs.sort()
priority_langs.reverse()
for pl in priority_langs:
if pl in langs:
langs.remove(pl)
langs.insert(0, pl)
gnomesum = 0
kdesum = 0
gnomekdesum = 0
for l in langs:
gsize = language_size(l, 'gnome')
ksize = language_size(l, 'kde')
gksize = language_size(l, '(gnome|kde)')
gnomesum += gsize
kdesum += ksize
gnomekdesum += gksize
if len(sys.argv) > 1 and sys.argv[1] == 'MB':
print "%-5s G: %8.2f K: %8.2f G+K: %8.2f GSum: %8.2f KSum: %8.2f G+KSum: %8.2f" % \
(l, gsize/1048576., ksize/1048576., gksize/1048576.,
gnomesum/1048576., kdesum/1048576., gnomekdesum/1048576.)
else:
print "%-5s G: %10i K: %10i G+K: %10i GSum: %10i KSum: %10i G+KSum: %10i" % \
(l, gsize, ksize, gksize, gnomesum, kdesum, gnomekdesum)
if __name__ == '__main__':
main()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-release/attachments/20120912/8c9747a2/attachment.pgp>
More information about the Ubuntu-release
mailing list