def handle(self, *args, **options): if args: langs = args else: langs = os.listdir(os.path.join(settings.ROOT, 'locale')) langs = filter(lambda x: x != 'templates', langs) # This is basically a wrapper around the gettext extract # command, we might want to do some things around this in the # future gettext_extract() pot_to_langfiles()
def handle(self, *args, **options): if args: langs = args else: langs = os.listdir(os.path.join(settings.ROOT, 'locale')) langs = filter(lambda x: x != 'templates', langs) langs = filter(lambda x: x[0] != '.', langs) # This is basically a wrapper around the gettext extract # command, we might want to do some things around this in the # future gettext_extract() pot_to_langfiles()
def handle(self, *args, **options): if args: # mimics tower.management.commands.extract for a list of files outputdir = os.path.join(settings.ROOT, 'locale', 'templates', 'LC_MESSAGES') if not os.path.isdir(outputdir): os.makedirs(outputdir) extracted = extract_from_files(args) catalog = extract.create_pofile_from_babel(extracted) catalog.savefile(os.path.join(outputdir, '%s.pot' % DOMAIN)) else: # This is basically a wrapper around the tower extract # command, we might want to do some things around this in the # future gettext_extract() pot_to_langfiles()