[saem-devel] [PATCH 1 of 2 eac] Mark NameEntry.form_variant as internationalizable

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Feb 21 17:58:32 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1485807454 -3600
#      Mon Jan 30 21:17:34 2017 +0100
# Node ID 5ae979d1498b42c106d0a304f9470a8c0301946f
# Parent  f8908599849cac910cef3d35fb512534037689c0
Mark NameEntry.form_variant as internationalizable

Else we see the untranslated value even when if the string is i18n marked in the schema.

diff --git a/migration/0.3.1_Any.py b/migration/0.3.1_Any.py
new file mode 100644
--- /dev/null
+++ b/migration/0.3.1_Any.py
@@ -0,0 +1,1 @@
+sync_schema_props_perms('form_variant')
diff --git a/schema.py b/schema.py
--- a/schema.py
+++ b/schema.py
@@ -57,11 +57,12 @@ class AuthorityRecord(EntityType):
 class NameEntry(EntityType):
     """Represent a nameEntry tag of an EAC-CPF document."""
     parts = String(
         required=True, fulltextindexed=True,
         description=_('concatenation of part tags within a nameEntry'))
-    form_variant = String(vocabulary=[_('authorized'), _('alternative')])
+    form_variant = String(internationalizable=True,
+                          vocabulary=[_('authorized'), _('alternative')])
 
 
 class name_entry_for(RelationDefinition):
     subject = 'NameEntry'
     object = 'AuthorityRecord'


More information about the saem-devel mailing list