Commit a873dc45 authored by Michal Čihař's avatar Michal Čihař

Simplify definitions of language name fixups

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 76867dba
...@@ -258,6 +258,21 @@ RTL_LANGS = set(( ...@@ -258,6 +258,21 @@ RTL_LANGS = set((
'yi', 'yi',
)) ))
# Fixups (mostly shortening) of langauge names
LANGUAGE_NAME_FIXUPS = {
'ia': 'Interlingua',
'el': 'Greek',
'st': 'Sotho',
'oc': 'Occitan',
'nb': 'Norwegian Bokmål',
'pa': 'Punjabi',
'zh_CN': 'Simplified Chinese',
'zh_TW': 'Traditional Chinese',
'ca@valencia': 'Valencian',
'ky': 'Kyrgyz',
}
# Following variables are used to map Gettext plural equations # Following variables are used to map Gettext plural equations
# to one/few/may/other like rules # to one/few/may/other like rules
......
...@@ -448,27 +448,8 @@ class Language(models.Model, PercentMixin): ...@@ -448,27 +448,8 @@ class Language(models.Model, PercentMixin):
''' '''
Fixes name, in most cases when wrong one is provided by ttkit. Fixes name, in most cases when wrong one is provided by ttkit.
''' '''
# Fixups (mostly shortening) of langauge names if self.code in data.LANGUAGE_NAME_FIXUPS:
if self.code == 'ia': self.name = data.LANGUAGE_NAME_FIXUPS[self.code]
self.name = 'Interlingua'
elif self.code == 'el':
self.name = 'Greek'
elif self.code == 'st':
self.name = 'Sotho'
elif self.code == 'oc':
self.name = 'Occitan'
elif self.code == 'nb':
self.name = 'Norwegian Bokmål'
elif self.code == 'pa':
self.name = 'Punjabi'
elif self.code == 'zh_CN':
self.name = 'Simplified Chinese'
elif self.code == 'zh_TW':
self.name = 'Traditional Chinese'
elif self.code == 'ca@valencia':
self.name = 'Valencian'
elif self.code == 'ky':
self.name = 'Kyrgyz'
def set_direction(self): def set_direction(self):
''' '''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment