Commit 8b154a6b authored by Michal Čihař's avatar Michal Čihař

Get params from language family if it is known

parent 7b6d897a
...@@ -82,6 +82,19 @@ class TranslationManager(models.Manager): ...@@ -82,6 +82,19 @@ class TranslationManager(models.Manager):
nplurals = 2, nplurals = 2,
pluralequation = '(n != 1)', pluralequation = '(n != 1)',
) )
# In case this is just a different variant of known language, get params from that
if '_' in code:
try:
baselang = Language.objects.get(code = code.split('_')[0])
lang.name = '%s (generated - %s)' % (
baselang.name,
code,
)
lang.nplurals = baselang.nplurals
lang.pluralequation = baselang.pluralequation
lang.save()
except Language.DoesNotExist:
pass
translation, created = self.get_or_create( translation, created = self.get_or_create(
language = lang, language = lang,
subproject = subproject, subproject = subproject,
......
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