import sys
import simplejson
import os.path
+import os
class DojoResource (basel10n.BaseL10N):
"""
# Avoid generating duplicate entries by keeping track of msgids
msgids = dict()
+ #print("Reading Dojo resource file %s" % (source))
bundle = simplejson.load(codecs.open(source, encoding='utf-8', mode='r'))
for key, value in bundle.iteritems():
if options.pot:
pot.get_strings(options.pot)
if options.outfile:
+ if not os.path.exists(options.outfile):
+ os.makedirs(os.path.dirname(options.outfile))
pot.savepot(options.outfile)
else:
sys.stdout.write(pot.pot.__str__())
pot.loadpo(options.create)
pot.create_bundle()
if options.outfile:
+ if not os.path.exists(options.outfile):
+ os.makedirs(os.path.dirname(options.outfile))
outfile = codecs.open(options.outfile, encoding='utf-8', mode='w')
simplejson.dump(pot.msgs, outfile, indent=4)
else: