xmpp.chapril.org-conversejs/lang/management/commands/setuplang.py
2012-02-27 10:28:33 +01:00

16 lines
499 B
Python

from django.core.management.base import BaseCommand, CommandError
from lang.models import Language
from translate.lang import data
class Command(BaseCommand):
help = 'Populates language definitions'
def handle(self, *args, **options):
for code, props in data.languages.items():
lang, created = Language.objects.get_or_create(
code = code,
name = props[0],
nplurals = props[1],
pluralequation = props[2])