aboutsummaryrefslogtreecommitdiffstats
path: root/docs/scripts/generate_desktop.py
blob: 28cabea98d396ec431e3c3bd5a42e39373fc8cbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

import os
manuals =["netinstall","mcc", "installer","draklive"]
langs={}
langs['netinstall'] = ['ca','cs','de','el','en','es','et','eu','fr','ja','nb','nl','pt_br','sl','sv','tr','uk','zh_CN']
langs['installer']=['ca','cs','de','el','en','eo','es','et','eu','fr','hr','hu','id','it','ja','nb','nl','pl','pt_br','ro','ru','sq','sv','tr','uk','zh_CN']
langs['mcc']=['ca','cs','da','de','el','en','eo','es','et','eu','fr','id','it','ja','nb','nl','pl','pt_br','ro','ru','sq','sv','tr','uk','zh_CN']
langs['draklive']=['cs','de','el','en','es','et','eu','fr','hr','ja','nb','nl','ro','ru','sk','sl','sq','sv','tr','uk','zh_CN']

languages_fr = {'ca':'catalan','cs':'tchèque','da':'danois', 'de':'allemand', 'el':'grec', 'en':'anglais','eo':'espéranto', 'es':'espagnol', 
                'et':'estonien','eu':'basque', 'fr':'français', 'hr':'croate','hu':'hongrois','id':'indonésien','it':'italien','ja':'japonais','nb':'norvégien','nl':'néerlandais','pl':'polonais',
                'pt_br':'Brésilien','ro':'roumain','ru':'russe', 'sk':'slovaque','sl':'slovène','sq':'albanais','sv':'suédois','tr':'turc', 'uk':'ukrainien', 'zh_CN':'chinois'}
languages_en = {'ca':'Catalan', 'cs':'Chech', 'da':'Danish','de':'German', 'el':'Greek', 'en':'English','eo':'Esperanto', 'es':'Spanish', 'et':'Estonian', 'eu':'Basque', 'fr':'French',
                'hr':'Croatian','hu':'Hungarian','id':'Indonesian','it':'Italian', 'ja':'Japanese','nl':'Dutch', 'nb':'Bokmal Norwegian','pl':'Polish', 'pt_br':'Brazilian Portuguese',
                'ro':'Romanian','ru':'Russian', 'sk':'Slovak','sl':'Slovenian','sq':'Albanian', 'sv':'Swedish', 'tr':'Turkish', 'uk':'Ukranian','zh_CN':'Simplified Chinese'}
for manual in manuals:
	for lang in langs[manual]:
		nom_fichier = '/home/yves/Documents/mageia-doc-trunk/{1}/desktop/mageia-doc-{1}-{0}.desktop'.format( lang, manual)
		with open(nom_fichier , 'w', encoding="utf-8") as nf:
			nf.write('[Desktop Entry]\n')
			nf.write('Name=@VENDOR@ Net Installer Manual in ' + languages_en[lang])
			nf.write("\nName[fr]=Manuel utilisateur de l'installation réseau de @VENDOR@ en " + languages_fr[lang])
			nf.write('\nComment=The @VENDOR@ manuals in ' + languages_en[lang])
			nf.write('\nComment[fr]=Les manuels utilisateur de @VENDOR@ en ' + languages_fr[lang])
			nf.write('\nExec=@BINDIR@/www-browser @DOCDIR@/mageia/{0}/{1}/index.html'.format(lang,manual))
			nf.write('\nIcon=documentation_section\nTerminal=false\nType=Application\nStartupNotify=true\nCategories=Documentation;Settings;')