Commit 0b2caafb authored by Michal Čihař's avatar Michal Čihař

Add management command to populate languages

parent f67437c2
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])
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