Adds Speech Synthesis and Localisation support

This commit is contained in:
Ana C. Custura 2017-01-08 16:59:00 +00:00
parent c3b53620a5
commit 327ec1cf91
5 changed files with 136 additions and 0 deletions

View file

@ -1,3 +1,4 @@
usr/bin
usr/lib
hooks/customise.sh usr/share/live-wrapper
languagelist usr/share/languagelist

105
languagelist Normal file
View file

@ -0,0 +1,105 @@
#
# This is the complete list of languages (locales) to choose from.
# langcode;language (en);language (orig);supported_environments;countrycode;fallbacklocale;langlist;console-setup
sq;Albanian;Shqip;2;AL;sq_AL.UTF-8;;console-setup
am;Amharic;አማርኛ;4;ET;am_ET;;
ar;Arabic;عربي;3;EG;ar_EG.UTF-8;;console-setup
ast;Asturian;Asturianu;2;ES;ast_ES.UTF-8;;console-setup
eu;Basque;Euskara;1;ES;eu_ES.UTF-8;;console-setup
be;Belarusian;Беларуская;2;BY;be_BY.UTF-8;;console-setup
bn;Bangla;বাংলা;4;BD;bn_BD;;
bs;Bosnian;Bosanski;2;BA;bs_BA.UTF-8;;console-setup
#X br;Breton;Brezhoneg;2;FR;br_FR.UTF-8;;console-setup
bg;Bulgarian;Български;2;BG;bg_BG.UTF-8;;console-setup
bo;Tibetan;བོད་ཡིག;4;IN;bo_IN;;
# For C locale, set language to 'en' to make sure questions are "translated"
# to English instead of showing codes.
C;C;No localization;0;;C;en;
ca;Catalan;Català;1;ES;ca_ES.UTF-8;;console-setup
# Special case for Chinese as the two flavours share the same ISO 639 code
# Both will trigger countrychooser. Each will be the backup for the other
# one
zh_CN;Chinese (Simplified);中文(简体);3;CN;zh_CN.UTF-8;zh_CN:zh;
zh_TW;Chinese (Traditional);中文(繁體);3;TW;zh_TW.UTF-8;zh_TW:zh;
#X the;Chitwania Tharu;थारु;4;NP;the_NP;;console-setup
hr;Croatian;Hrvatski;2;HR;hr_HR.UTF-8;;console-setup
cs;Czech;Čeština;2;CZ;cs_CZ.UTF-8;;console-setup
da;Danish;Dansk;1;DK;da_DK.UTF-8;;console-setup
nl;Dutch;Nederlands;1;NL;nl_NL.UTF-8;;console-setup
dz;Dzongkha;རྫོང་ཁ།;4;BT;dz_BT;;
en;English;English;0;US;en_US.UTF-8;;console-setup
# The Esperanto locale is eo.UTF-8
# so no country on purpose. The default country is Antarctica because...
# ...why not..:-)
eo;Esperanto;Esperanto;2;AQ;eo.UTF-8;;console-setup
et;Estonian;Eesti;2;EE;et_EE.UTF-8;;console-setup
fi;Finnish;Suomi;1;FI;fi_FI.UTF-8;;console-setup
fr;French;Français;1;FR;fr_FR.UTF-8;;console-setup
gl;Galician;Galego;1;ES;gl_ES.UTF-8;;console-setup
ka;Georgian;ქართული;4;GE;ka_GE.UTF-8;;console-setup
de;German;Deutsch;1;DE;de_DE.UTF-8;;console-setup
el;Greek;Ελληνικά;2;GR;el_GR.UTF-8;;console-setup
gu;Gujarati;ગુજરાતી;4;IN;gu_IN;;
he;Hebrew;עברית;3;IL;he_IL.UTF-8;;console-setup
hi;Hindi;हिन्दी ;4;IN;hi_IN;;
hu;Hungarian;Magyar;2;HU;hu_HU.UTF-8;;console-setup
is;Icelandic;Íslenska;1;IS;is_IS.UTF-8;;console-setup
id;Indonesian;Bahasa Indonesia;1;ID;id_ID.UTF-8;;console-setup
ga;Irish;Gaeilge;1;IE;ga_IE.UTF-8;;console-setup
it;Italian;Italiano;1;IT;it_IT.UTF-8;;console-setup
#X jam;Jamaican Creole English;Jamaican Creole English;1;JM;jam_JM;;console-setup
ja;Japanese;日本語;3;JP;ja_JP.UTF-8;;
#X ks;Kashmiri;कोशुर;4;IN;ks_IN;;
kk;Kazakh;Қазақ;2;KZ;kk_KZ.UTF-8;;console-setup
km;Khmer;ខ្មែរ;4;KH;km_KH;;
kn;Kannada;ಕನ್ನಡ;4;IN;kn_IN;;
ko;Korean;한국어;3;KR;ko_KR.UTF-8;;
ku;Kurdish;Kurdî;2;TR;ku_TR.UTF-8;;console-setup
#X ky;Kirghiz;Кыргызча;2;KG;ky_KG;;console-setup
lo;Lao;ລາວ;4;LA;lo_LA;;console-setup
lv;Latvian;Latviski;2;LV;lv_LV.UTF-8;;console-setup
lt;Lithuanian;Lietuviškai;2;LT;lt_LT.UTF-8;;console-setup
#X mg;Malagasy;Malagasy;1;MG;mg_MG.UTF-8;mg_MG:fr_FR:fr:en;console-setup
#X ms;Malay;Bahasa Malaysia;1;MY;ms_MY.UTF-8;;console-setup
ml;Malayalam;മലയാളം;4;IN;ml_IN;;
mr;Marathi;मराठी;4;IN;mr_IN;;
mk;Macedonian;Македонски;2;MK;mk_MK.UTF-8;;console-setup
my;Burmese; မြန်မာစာ;4;MM;my_MM;;
ne;Nepali;नेपाली ;4;NP;ne_NP;;
# The Sami translation is really incomplete. We however keep Sami on request
# of Skolelinux as a kind of reward to them..:-). They need to be able to
# choose Sami as an option so that the Sami locale is set as default
se_NO;Northern Sami;Sámegillii;1;NO;se_NO;se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en;console-setup
nb_NO;Norwegian Bokmaal;Norsk bokmål;1;NO;nb_NO.UTF-8;nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en;console-setup
nn_NO;Norwegian Nynorsk;Norsk nynorsk;1;NO;nn_NO.UTF-8;nn_NO:nn:no_NO:no:nb_NO:nb:da:sv:en;console-setup
#X os;Ossetian;Ирон æвзаг;3;RU;os_RU;;console-setup
fa;Persian;فارسی;3;IR;fa_IR;;console-setup
pl;Polish;Polski;2;PL;pl_PL.UTF-8;;console-setup
pt;Portuguese;Português;1;PT;pt_PT.UTF-8;pt:pt_BR:en;console-setup
pt_BR;Portuguese (Brazil);Português do Brasil;1;BR;pt_BR.UTF-8;pt_BR:pt:en;console-setup
pa;Punjabi (Gurmukhi);ਪੰਜਾਬੀ;4;IN;pa_IN;;
ro;Romanian;Română;2;RO;ro_RO.UTF-8;;console-setup
ru;Russian;Русский;2;RU;ru_RU.UTF-8;;console-setup
#X sa;Sanskrit;संस्कृत;4;IN;sa_IN;;
#X sd;Sindhi;سنڌي;3;PK;sd_PK.UTF-8;;console-setup
si;Sinhala;සිංහල;4;LK;si_LK;;
sr;Serbian (Cyrillic);Српски;2;RS;sr_RS;;console-setup
#X sr@latin;Serbian (Latin);Srpski;2;RS;sr_RS@latin;;console-setup
sk;Slovak;Slovenčina;2;SK;sk_SK.UTF-8;;console-setup
sl;Slovenian;Slovenščina;2;SI;sl_SI.UTF-8;;console-setup
es;Spanish;Español;1;ES;es_ES.UTF-8;;console-setup
sv;Swedish;Svenska;1;SE;sv_SE.UTF-8;;console-setup
tl;Tagalog;Tagalog;1;PH;tl_PH.UTF-8;;console-setup
ta;Tamil;தமிழ்;4;IN;ta_IN;;
te;Telugu;తెలుగు;4;IN;te_IN;;
tg;Tajik;Тоҷикӣ;2;TJ;tg_TJ.UTF-8;;console-setup
th;Thai;ภาษาไทย;3;TH;th_TH.UTF-8;;console-setup
tr;Turkish;Türkçe;2;TR;tr_TR.UTF-8;;console-setup
ug;Uyghur;ئۇيغۇرچە;3;CN;ug_CN;;
uk;Ukrainian;Українська;2;UA;uk_UA.UTF-8;;console-setup
#X ur;Urdu;اردو;3;PK;ur_PK.UTF-8;;console-setup
#X ca@valencia;Valencian-Catalan;Valencià-Català;1;ES;ca_ES.UTF-8@valencia;;console-setup
vi;Vietnamese;Tiếng Việt;3;VN;vi_VN;;console-setup
cy;Welsh;Cymraeg;2;GB;cy_GB.UTF-8;;console-setup
#X wo;Wolof;Wolof;2;SN;wo_SN;wo:fr:en;
#X xh;Xhosa;Xhosa;2;ZA;xh_ZA.UTF-8;;console-setup

View file

@ -39,6 +39,32 @@ class BootloaderConfig(object):
'kernel': '/d-i/%s' % (os.path.basename(kernel),),
'initrd': '/d-i/%s' % (os.path.basename(ramdisk),),
})
self.entries.append({
'description': 'Debian Installer with Speech Synthesis',
'type': 'linux',
'kernel': '/d-i/gtk/%s' % (os.path.basename(kernel),),
'initrd': '/d-i/gtk/%s' % (os.path.basename(ramdisk),),
'cmdline': 'speakup.synth=soft',
})
def add_live_localisation(self):
# FIXME: need declarative paths
self.versions = detect_kernels(self.cdroot)
self.versions.sort(reverse=True)
#FIXME: the path of languagelist to be changed to /usr/share/live-wrapper/languagelist for debian package
with open('languagelist', 'r') as f:
lines = f.readlines()
lang_lines = [ line for line in lines if not line.startswith('#') ]
for line in lang_lines:
language = line.split(';')
for version in self.versions:
self.entries.append({
'description': '%s (%s)' % (language[1], language[0],),
'type': 'linux',
'kernel': '/live/vmlinuz-%s' % (version,),
'cmdline': 'boot=live components locales=%s' % (language[5],),
'initrd': '/live/initrd.img-%s' % (version,),
})
def add_submenu(self, description, loadercfg):
self.entries.append({

View file

@ -47,6 +47,7 @@ def generate_cfg(bootconfig, submenu=False):
ret += " LABEL mainmenu \n "
ret += " MENU label Back\n "
ret += " MENU exit\n "
ret += " MENU end\n "
# do not want to default to menus
if first:

View file

@ -255,6 +255,9 @@ class LiveWrapper(cliapp.Application):
if os.environ.get("LWR_DEBUG") is None or not 'skipvm' in os.environ['LWR_DEBUG']:
bootconfig.add_live()
locallivecfg = BootloaderConfig(self.cdroot.path)
locallivecfg.add_live_localisation()
bootconfig.add_submenu('Debian Live with Localisation Support', locallivecfg)
if self.settings['installer']:
bootconfig.add_installer(self.kernel_path, self.ramdisk_path)