Commit 59732641 authored by's avatar
Browse files

don't add to cube i18n catalog msg id for components redefined from cw or from a depending cube

branch : tls-sprint
parent ba9759972b52
......@@ -86,30 +86,31 @@ def generate_schema_pot(w, cubedir=None):
from cubicweb.cwvreg import CubicWebRegistry
cube = cubedir and split(cubedir)[-1]
config = DevDepConfiguration(cube)
libconfig = DevDepConfiguration(cube)
libconfig.cleanup_interface_sobjects = False
if cubedir:
libschema = config.load_schema()
config = DevCubeConfiguration(cube)
schema = config.load_schema()
schema = config.load_schema()
libschema = None
config.cleanup_interface_sobjects = False
config = libconfig
libconfig = None
vreg = CubicWebRegistry(config)
# set_schema triggers objects registrations
_generate_schema_pot(w, vreg, schema, libschema=libschema, cube=cube)
_generate_schema_pot(w, vreg, schema, libconfig=libconfig, cube=cube)
def _generate_schema_pot(w, vreg, schema, libschema=None, cube=None):
def _generate_schema_pot(w, vreg, schema, libconfig=None, cube=None):
from cubicweb.common.i18n import add_msg
w('# schema pot file, generated on %s\n' %'%Y-%m-%d %H:%M:%S'))
w('# \n')
w('# singular and plural forms for each entity type\n')
if libschema is not None:
if libconfig is not None:
libschema = libconfig.load_schema()
entities = [e for e in schema.entities() if not e in libschema]
entities = schema.entities()
......@@ -170,18 +171,30 @@ def _generate_schema_pot(w, vreg, schema, libschema=None, cube=None):
teschema, teschema, rschema, eschema)
add_msg(w, label)
add_msg(w, label2)
cube = (cube and 'cubes.%s.' % cube or 'cubicweb.')
#cube = (cube and 'cubes.%s.' % cube or 'cubicweb.')
done = set()
if libconfig is not None:
from cubicweb.cwvreg import CubicWebRegistry
libvreg = CubicWebRegistry(libconfig)
libvreg.set_schema(libschema) # trigger objects registration
# prefill done set
list(_iter_vreg_objids(libvreg, done))
print 'done', done
for objid in _iter_vreg_objids(vreg, done):
add_msg(w, '%s_description' % objid)
add_msg(w, objid)
def _iter_vreg_objids(vreg, done, prefix=None):
for reg, objdict in vreg.items():
for objects in objdict.values():
for obj in objects:
objid = '%s_%s' % (reg,
if objid in done:
if obj.__module__.startswith(cube) and obj.property_defs:
add_msg(w, '%s_description' % objid)
add_msg(w, objid)
if obj.property_defs:
yield objid
def defined_in_library(libschema, etype, rtype, tetype, role):
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