Commit 1eab0c0f authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[schema categorization] new NO_I18NCONTEXT set usable to somewhat control c-c i18n

parent 2e3dabe00987
......@@ -122,8 +122,7 @@ def _generate_schema_pot(w, vreg, schema, libconfig=None):
from copy import deepcopy
from cubicweb.i18n import add_msg
from cubicweb.web import uicfg
from cubicweb.schema import META_RTYPES, WORKFLOW_RTYPES, CONSTRAINTS
no_context_rtypes = META_RTYPES | WORKFLOW_RTYPES
from cubicweb.schema import NO_I18NCONTEXT, CONSTRAINTS
w('# schema pot file, generated on %s\n'
% datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
w('# \n')
......@@ -212,13 +211,13 @@ def _generate_schema_pot(w, vreg, schema, libconfig=None):
else:
librschema = libschema.rschema(rtype)
# add context information only for non-metadata rtypes
if rschema not in no_context_rtypes:
if rschema not in NO_I18NCONTEXT:
libsubjects = librschema and librschema.subjects() or ()
for subjschema in rschema.subjects():
if not subjschema in libsubjects:
add_msg(w, rtype, subjschema.type)
if not (schema.rschema(rtype).final or rschema.symmetric):
if rschema not in no_context_rtypes:
if rschema not in NO_I18NCONTEXT:
libobjects = librschema and librschema.objects() or ()
for objschema in rschema.objects():
if not objschema in libobjects:
......
......@@ -62,6 +62,8 @@ SYSTEM_RTYPES = set(('in_group', 'require_group', 'require_permission',
# cwproperty
'for_user',
)) | WORKFLOW_RTYPES
NO_I18NCONTEXT = META_RTYPES | WORKFLOW_RTYPES
NO_I18NCONTEXT.add('require_permission')
# set of entity and relation types used to build the schema
SCHEMA_TYPES = set((
......
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