xmpp.chapril.org-conversejs/trans/management/commands/loadpo.py

21 lines
730 B
Python
Raw Normal View History

2012-02-28 15:20:44 +01:00
from django.core.management.base import BaseCommand, CommandError
from trans.models import SubProject
from optparse import make_option
2012-02-28 15:20:44 +01:00
class Command(BaseCommand):
help = '(re)loads translations from disk'
args = '<project/subproject>'
option_list = BaseCommand.option_list + (
make_option('--force',
action='store_true',
dest='force',
default=False,
help='Force rereading files even when they should be up to date'),
)
2012-02-28 15:20:44 +01:00
def handle(self, *args, **options):
for arg in args:
prj, subprj = arg.split('/')
s = SubProject.objects.get(slug = subprj, project__slug = prj)
s.create_translations(options['force'])