Commit aa75d7cc authored by's avatar
Browse files

fix i18n catalog compilation

branch : tls-sprint
parent c80ca83a382f
......@@ -93,8 +93,8 @@ def generate_schema_pot(w, cubedir=None):
config = DevCubeConfiguration(cube)
schema = config.load_schema()
schema = config.load_schema()
config = libconfig
schema = config.load_schema()
libconfig = None
vreg = CubicWebRegistry(config)
# set_schema triggers objects registrations
......@@ -130,7 +130,7 @@ def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
w('# subject and object forms for each relation type\n')
w('# (no object form for final relation types)\n')
if libschema is not None:
if libconfig is not None:
relations = [r for r in schema.relations() if not r in libschema]
relations = schema.relations()
......@@ -155,9 +155,13 @@ def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
if rschema.is_final():
for teschema in rschema.targets(eschema, role):
if defined_in_library(libschema, eschema, rschema,
teschema, role):
if libconfig is not None:
if role == 'subject':
subjtype, objtype = etype, tetype
subjtype, objtype = tetype, etype
if libschema.rschema(rtype).has_rdef(subjtype, objtype):
if actionbox.relation_mode(rschema, eschema, teschema, role) == 'create':
if role == 'subject':
label = 'add %s %s %s %s' % (eschema, rschema,
......@@ -197,7 +201,7 @@ def _iter_vreg_objids(vreg, done, prefix=None):
def defined_in_library(libschema, etype, rtype, tetype, role):
def defined_in_library(etype, rtype, tetype, role):
"""return true if the given relation definition exists in cubicweb's library
if libschema is None:
......@@ -271,8 +275,12 @@ class UpdateCubicWebCatalogCommand(Command):
cmd = 'xgettext --no-location --omit-header -k_ -o %s %s'
if lang is not None:
cmd += ' -L %s' % lang
potfiles.append(join(tempdir, '%s.pot' % id))
execute(cmd % (potfiles[-1], ' '.join(files)))
potfile = join(tempdir, '%s.pot' % id)
execute(cmd % (potfile, ' '.join(files)))
if exists(potfile):
print 'WARNING: %s file not generated' % potfile
print '******** merging .pot files'
cubicwebpot = join(tempdir, 'cubicweb.pot')
execute('msgcat %s > %s' % (' '.join(potfiles), cubicwebpot))
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