Browse Source

Use upstream translations for unforked packages for all available languages.

If Devuan translations are not available, remove the translation of any forked
packages as it may be incorrect..
wip/archive
Mark Hindley 2 years ago
parent
commit
8966814ba3
  1. 15
      amprolla_merge_translations.py
  2. 72
      lib/config.def.py

15
amprolla_merge_translations.py

@ -26,11 +26,24 @@ def merge_translations(filelist):
"""
merged_trnsl = {}
for i in filelist[::-1]: # Slice list in reverse repo_order so Devuan is merged last.
if i and isfile(i):
if i is None:
continue
elif isfile(i):
tfile = bz2_open(i).read()
tfile = tfile.decode('utf-8')
trnsl = parse_packages(tfile)
merged_trnsl.update(trnsl)
elif merged_trnsl and i == filelist[0]:
# In the absence of Devuan translations for forked packages, just
# remove upstream ones in case they are incorrect.
import re
en_trnsl = re.sub('-[a-z]{2}(_[A-Z]{2})?', '-en', i)
tfile = bz2_open(en_trnsl).read()
tfile = tfile.decode('utf-8')
trnsl = parse_packages(tfile)
print("%s not found: removing upstream translations of forked packages" % i)
for k in trnsl.keys():
merged_trnsl.pop(k, None)
return merged_trnsl

72
lib/config.def.py

@ -414,41 +414,41 @@ sources_keys = [
# Debian Translation languages as of June 2020
i18n = [
# 'bg',
# 'ca',
# 'cs',
# 'da',
# 'de',
# 'de_DE',
# 'el',
'bg',
'ca',
'cs',
'da',
'de',
'de_DE',
'el',
'en',
# 'eo',
# 'es',
# 'eu',
# 'fi',
# 'fr',
# 'hr',
# 'hu',
# 'id',
# 'it',
# 'ja',
# 'km',
# 'ko',
# 'ml',
# 'nb',
# 'nl',
# 'pl',
# 'pt',
# 'pt_BR',
# 'ro',
# 'ru',
# 'sk',
# 'sr',
# 'sv',
# 'tr',
# 'uk',
# 'vi',
# 'zh',
# 'zh_CN',
# 'zh_TW',
'eo',
'es',
'eu',
'fi',
'fr',
'hr',
'hu',
'id',
'it',
'ja',
'km',
'ko',
'ml',
'nb',
'nl',
'pl',
'pt',
'pt_BR',
'ro',
'ru',
'sk',
'sr',
'sv',
'tr',
'uk',
'vi',
'zh',
'zh_CN',
'zh_TW',
]

Loading…
Cancel
Save