Define some extra languages

This commit is contained in:
Michal Čihař 2012-02-27 16:12:14 +01:00
parent 4780f64678
commit 00f8eca6f8

View File

@ -2,6 +2,10 @@ from django.core.management.base import BaseCommand, CommandError
from lang.models import Language from lang.models import Language
from translate.lang import data from translate.lang import data
EXTRALANGS = [
('ur', 'Urdu', 2, '(n != 1)'),
]
class Command(BaseCommand): class Command(BaseCommand):
help = 'Populates language definitions' help = 'Populates language definitions'
@ -12,4 +16,10 @@ class Command(BaseCommand):
name = props[0], name = props[0],
nplurals = props[1], nplurals = props[1],
pluralequation = props[2]) pluralequation = props[2])
for props in EXTRALANGS:
lang, created = Language.objects.get_or_create(
code = props[0],
name = props[1],
nplurals = props[2],
pluralequation = props[3])