# HG changeset patch # User Sylvain Thénault # Date 1353062498 -3600 # Node ID 001159e2e4f3be8283e197e8fec2ce4ab5c5381f # Parent 41259e1f9d489f2be45639f74ed4be0de9e639fd [validation api] properly use yams 0.36 validation error api and update message catalog. Follows bbe0d6985e59 the creation of the `translate` method in the 23a10f049447 yams commit. diff -r 41259e1f9d48 -r 001159e2e4f3 __init__.py --- a/__init__.py Fri Nov 09 15:27:40 2012 +0100 +++ b/__init__.py Fri Nov 16 11:41:38 2012 +0100 @@ -215,7 +215,7 @@ """ if substitutions is None: # set empty dict else translation won't be done for backward - # compatibility reason (see ValidationError.tr method) + # compatibility reason (see ValidationError.translate method) substitutions = {} for key in errors.keys(): if isinstance(key, tuple): diff -r 41259e1f9d48 -r 001159e2e4f3 hooks/test/unittest_hooks.py --- a/hooks/test/unittest_hooks.py Fri Nov 09 15:27:40 2012 +0100 +++ b/hooks/test/unittest_hooks.py Fri Nov 16 11:41:38 2012 +0100 @@ -165,14 +165,12 @@ self.execute, 'INSERT CWRType X: X name "in_group"') def test_validation_unique_constraint(self): - self.assertRaises(ValidationError, - self.execute, 'INSERT CWUser X: X login "admin"') - try: + with self.assertRaises(ValidationError) as cm: self.execute('INSERT CWUser X: X login "admin"') - except ValidationError, ex: - ex.tr(unicode) - self.assertIsInstance(ex.entity, int) - self.assertEqual(ex.errors, {'login-subject': 'the value "admin" is already used, use another one'}) + ex = cm.exception + ex.translate(unicode) + self.assertIsInstance(ex.entity, int) + self.assertEqual(ex.errors, {'login-subject': 'the value "admin" is already used, use another one'}) if __name__ == '__main__': diff -r 41259e1f9d48 -r 001159e2e4f3 hooks/test/unittest_syncsession.py --- a/hooks/test/unittest_syncsession.py Fri Nov 09 15:27:40 2012 +0100 +++ b/hooks/test/unittest_syncsession.py Fri Nov 16 11:41:38 2012 +0100 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -31,11 +31,11 @@ def test_unexistant_cwproperty(self): with self.assertRaises(ValidationError) as cm: self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop", X for_user U') - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) with self.assertRaises(ValidationError) as cm: self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop"') - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) def test_site_wide_cwproperty(self): diff -r 41259e1f9d48 -r 001159e2e4f3 i18n/de.po --- a/i18n/de.po Fri Nov 09 15:27:40 2012 +0100 +++ b/i18n/de.po Fri Nov 16 11:41:38 2012 +0100 @@ -50,6 +50,14 @@ msgstr "" #, python-format +msgid "%(KEY-cstr)s constraint failed for value %(KEY-value)r" +msgstr "" + +#, python-format +msgid "%(KEY-value)r doesn't match the %(KEY-regexp)r regular expression" +msgstr "" + +#, python-format msgid "%(attr)s set to %(newvalue)s" msgstr "%(attr)s geändert in %(newvalue)s" @@ -58,10 +66,6 @@ msgstr "%(attr)s geändert von %(oldvalue)s in %(newvalue)s" #, python-format -msgid "%(cstr)s constraint failed for value %(value)r" -msgstr "%(cstr)s Einschränkung verletzt für Wert %(value)r" - -#, python-format msgid "%(etype)s by %(author)s" msgstr "" @@ -74,10 +78,6 @@ msgstr "%(subject)s %(etype)s #%(eid)s (%(login)s)" #, python-format -msgid "%(value)r doesn't match the %(regexp)r regular expression" -msgstr "%(value)r entspricht nicht dem regulären Ausdruck %(regexp)r" - -#, python-format msgid "%d days" msgstr "%d Tage" @@ -427,6 +427,11 @@ msgid "Click to sort on this column" msgstr "" +msgid "" +"Configuration of the system source goes to the 'sources' file, not in the " +"database" +msgstr "" + #, python-format msgid "Created %(etype)s : %(entity)s" msgstr "" @@ -897,6 +902,9 @@ msgid "UniqueConstraint" msgstr "eindeutige Einschränkung" +msgid "Unknown source type" +msgstr "" + msgid "Unreachable objects" msgstr "unzugängliche Objekte" @@ -955,6 +963,15 @@ msgid "You can use any of the following substitutions in your text" msgstr "Sie können die folgenden Ersetzungen in Ihrem Text verwenden:" +msgid "You can't change this relation" +msgstr "" + +msgid "You cannot remove the system source" +msgstr "" + +msgid "You cannot rename the system source" +msgstr "" + msgid "" "You have no access to this view or it can not be used to display the current " "data." @@ -1384,11 +1401,7 @@ msgid "can't be deleted" msgstr "kann nicht entfernt werden" -#, python-format -msgid "can't change the %s attribute" -msgstr "Kann das Attribut %s nicht ändern." - -msgid "can't change this relation" +msgid "can't change this attribute" msgstr "" #, python-format @@ -2854,8 +2867,8 @@ msgstr "Unzulässiger Wert für Überschrift" #, python-format -msgid "incorrect value (%(value)s) for type \"%(type)s\"" -msgstr "Wert %(value)s ungültig für den Typ \"%(type)s\"" +msgid "incorrect value (%(KEY-value)r) for type \"%(KEY-type)s\"" +msgstr "" msgid "index this attribute's value in the plain text index" msgstr "indizieren des Wertes dieses Attributs im Volltext-Index" @@ -2933,8 +2946,8 @@ msgstr "Ungültige Aktion %r" #, python-format -msgid "invalid value %(value)s, it must be one of %(choices)s" -msgstr "Wert %(value)s ungültig, er muss zwischen %(choices)s" +msgid "invalid value %(KEY-value)s, it must be one of %(KEY-choices)s" +msgstr "" msgid "is" msgstr "vom Typ" @@ -4314,9 +4327,6 @@ msgid "unknown property key %s" msgstr "Unbekannter Eigentumsschlüssel %s" -msgid "unknown source type" -msgstr "" - msgid "unknown vocabulary:" msgstr "Unbekanntes Wörterbuch : " @@ -4462,15 +4472,7 @@ msgstr "Wert" #, python-format -msgid "value %(value)s must be %(op)s %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be <= %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be >= %(boundary)s" +msgid "value %(KEY-value)s must be %(KEY-op)s %(KEY-boundary)s" msgstr "" msgid "value associated to this key is not editable manually" @@ -4479,11 +4481,11 @@ "werden." #, python-format -msgid "value should have maximum size of %s but found %s" +msgid "value should have maximum size of %(KEY-max)s but found %(KEY-size)s" msgstr "" #, python-format -msgid "value should have minimum size of %s but found %s" +msgid "value should have minimum size of %(KEY-min)s but found %(KEY-size)s" msgstr "" msgid "vcard" @@ -4628,9 +4630,24 @@ msgid "you should un-inline relation %s which is supported and may be crossed " msgstr "" +#~ msgid "%(cstr)s constraint failed for value %(value)r" +#~ msgstr "%(cstr)s Einschränkung verletzt für Wert %(value)r" + +#~ msgid "%(value)r doesn't match the %(regexp)r regular expression" +#~ msgstr "%(value)r entspricht nicht dem regulären Ausdruck %(regexp)r" + #~ msgid "" #~ "Can't restore relation %(rtype)s of entity %(eid)s, this relation does " #~ "not exists anymore in the schema." #~ msgstr "" #~ "Kann die Relation %(rtype)s der Entität %(eid)s nicht wieder herstellen, " #~ "diese Relation existiert nicht mehr in dem Schema." + +#~ msgid "can't change the %s attribute" +#~ msgstr "Kann das Attribut %s nicht ändern." + +#~ msgid "incorrect value (%(value)s) for type \"%(type)s\"" +#~ msgstr "Wert %(value)s ungültig für den Typ \"%(type)s\"" + +#~ msgid "invalid value %(value)s, it must be one of %(choices)s" +#~ msgstr "Wert %(value)s ungültig, er muss zwischen %(choices)s" diff -r 41259e1f9d48 -r 001159e2e4f3 i18n/en.po --- a/i18n/en.po Fri Nov 09 15:27:40 2012 +0100 +++ b/i18n/en.po Fri Nov 16 11:41:38 2012 +0100 @@ -42,6 +42,14 @@ msgstr "" #, python-format +msgid "%(KEY-cstr)s constraint failed for value %(KEY-value)r" +msgstr "" + +#, python-format +msgid "%(KEY-value)r doesn't match the %(KEY-regexp)r regular expression" +msgstr "" + +#, python-format msgid "%(attr)s set to %(newvalue)s" msgstr "" @@ -50,10 +58,6 @@ msgstr "" #, python-format -msgid "%(cstr)s constraint failed for value %(value)r" -msgstr "" - -#, python-format msgid "%(etype)s by %(author)s" msgstr "" @@ -66,10 +70,6 @@ msgstr "" #, python-format -msgid "%(value)r doesn't match the %(regexp)r regular expression" -msgstr "" - -#, python-format msgid "%d days" msgstr "" @@ -405,6 +405,11 @@ msgid "Click to sort on this column" msgstr "" +msgid "" +"Configuration of the system source goes to the 'sources' file, not in the " +"database" +msgstr "" + #, python-format msgid "Created %(etype)s : %(entity)s" msgstr "" @@ -873,6 +878,9 @@ msgid "UniqueConstraint" msgstr "unique constraint" +msgid "Unknown source type" +msgstr "" + msgid "Unreachable objects" msgstr "" @@ -924,6 +932,15 @@ msgid "You can use any of the following substitutions in your text" msgstr "" +msgid "You can't change this relation" +msgstr "" + +msgid "You cannot remove the system source" +msgstr "" + +msgid "You cannot rename the system source" +msgstr "" + msgid "" "You have no access to this view or it can not be used to display the current " "data." @@ -1341,11 +1358,7 @@ msgid "can't be deleted" msgstr "" -#, python-format -msgid "can't change the %s attribute" -msgstr "" - -msgid "can't change this relation" +msgid "can't change this attribute" msgstr "" #, python-format @@ -2783,7 +2796,7 @@ msgstr "" #, python-format -msgid "incorrect value (%(value)s) for type \"%(type)s\"" +msgid "incorrect value (%(KEY-value)r) for type \"%(KEY-type)s\"" msgstr "" msgid "index this attribute's value in the plain text index" @@ -2860,7 +2873,7 @@ msgstr "" #, python-format -msgid "invalid value %(value)s, it must be one of %(choices)s" +msgid "invalid value %(KEY-value)s, it must be one of %(KEY-choices)s" msgstr "" msgid "is" @@ -4214,9 +4227,6 @@ msgid "unknown property key %s" msgstr "" -msgid "unknown source type" -msgstr "" - msgid "unknown vocabulary:" msgstr "" @@ -4353,26 +4363,18 @@ msgstr "" #, python-format -msgid "value %(value)s must be %(op)s %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be <= %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be >= %(boundary)s" +msgid "value %(KEY-value)s must be %(KEY-op)s %(KEY-boundary)s" msgstr "" msgid "value associated to this key is not editable manually" msgstr "" #, python-format -msgid "value should have maximum size of %s but found %s" +msgid "value should have maximum size of %(KEY-max)s but found %(KEY-size)s" msgstr "" #, python-format -msgid "value should have minimum size of %s but found %s" +msgid "value should have minimum size of %(KEY-min)s but found %(KEY-size)s" msgstr "" msgid "vcard" diff -r 41259e1f9d48 -r 001159e2e4f3 i18n/es.po --- a/i18n/es.po Fri Nov 09 15:27:40 2012 +0100 +++ b/i18n/es.po Fri Nov 16 11:41:38 2012 +0100 @@ -51,6 +51,14 @@ "\"role=subject\" o \"role=object\" debe ser especificado en las opciones" #, python-format +msgid "%(KEY-cstr)s constraint failed for value %(KEY-value)r" +msgstr "" + +#, python-format +msgid "%(KEY-value)r doesn't match the %(KEY-regexp)r regular expression" +msgstr "" + +#, python-format msgid "%(attr)s set to %(newvalue)s" msgstr "%(attr)s modificado a %(newvalue)s" @@ -59,10 +67,6 @@ msgstr "%(attr)s modificado de %(oldvalue)s a %(newvalue)s" #, python-format -msgid "%(cstr)s constraint failed for value %(value)r" -msgstr "el valor %(value)r no satisface la condición %(cstr)s" - -#, python-format msgid "%(etype)s by %(author)s" msgstr "%(etype)s por %(author)s" @@ -75,10 +79,6 @@ msgstr "%(subject)s %(etype)s #%(eid)s (%(login)s)" #, python-format -msgid "%(value)r doesn't match the %(regexp)r regular expression" -msgstr "%(value)r no corresponde a la expresión regular %(regexp)r" - -#, python-format msgid "%d days" msgstr "%d días" @@ -427,6 +427,11 @@ msgid "Click to sort on this column" msgstr "" +msgid "" +"Configuration of the system source goes to the 'sources' file, not in the " +"database" +msgstr "" + #, python-format msgid "Created %(etype)s : %(entity)s" msgstr "" @@ -900,6 +905,9 @@ msgid "UniqueConstraint" msgstr "Restricción de Unicidad" +msgid "Unknown source type" +msgstr "" + msgid "Unreachable objects" msgstr "Objetos inaccesibles" @@ -960,6 +968,15 @@ "Puede realizar cualquiera de las siguientes sustituciones en el contenido de " "su email." +msgid "You can't change this relation" +msgstr "" + +msgid "You cannot remove the system source" +msgstr "" + +msgid "You cannot rename the system source" +msgstr "" + msgid "" "You have no access to this view or it can not be used to display the current " "data." @@ -1395,12 +1412,8 @@ msgid "can't be deleted" msgstr "No puede ser eliminado" -#, python-format -msgid "can't change the %s attribute" -msgstr "no puede modificar el atributo %s" - -msgid "can't change this relation" -msgstr "no puede modificar esta relación" +msgid "can't change this attribute" +msgstr "" #, python-format msgid "can't connect to source %s, some data may be missing" @@ -2896,8 +2909,8 @@ msgstr "Valor del Captcha incorrecto" #, python-format -msgid "incorrect value (%(value)s) for type \"%(type)s\"" -msgstr "valor %(value)s incorrecto para el tipo \"%(type)s\"" +msgid "incorrect value (%(KEY-value)r) for type \"%(KEY-type)s\"" +msgstr "" msgid "index this attribute's value in the plain text index" msgstr "Indexar el valor de este atributo en el índice de texto simple" @@ -2976,8 +2989,8 @@ msgstr "Acción %r invalida" #, python-format -msgid "invalid value %(value)s, it must be one of %(choices)s" -msgstr "Valor %(value)s incorrecto, debe estar entre %(choices)s" +msgid "invalid value %(KEY-value)s, it must be one of %(KEY-choices)s" +msgstr "" msgid "is" msgstr "es" @@ -4364,9 +4377,6 @@ msgid "unknown property key %s" msgstr "Clave de Propiedad desconocida: %s" -msgid "unknown source type" -msgstr "tipo de fuente desconocida" - msgid "unknown vocabulary:" msgstr "Vocabulario desconocido: " @@ -4512,26 +4522,18 @@ msgstr "Vampr" #, python-format -msgid "value %(value)s must be %(op)s %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be <= %(boundary)s" -msgstr "" - -#, python-format -msgid "value %(value)s must be >= %(boundary)s" +msgid "value %(KEY-value)s must be %(KEY-op)s %(KEY-boundary)s" msgstr "" msgid "value associated to this key is not editable manually" msgstr "El valor asociado a este elemento no es editable manualmente" #, python-format -msgid "value should have maximum size of %s but found %s" +msgid "value should have maximum size of %(KEY-max)s but found %(KEY-size)s" msgstr "" #, python-format -msgid "value should have minimum size of %s but found %s" +msgid "value should have minimum size of %(KEY-min)s but found %(KEY-size)s" msgstr "" msgid "vcard" @@ -4679,9 +4681,30 @@ "usted debe quitar la puesta en línea de la relación %s que es aceptada y " "puede ser cruzada" +#~ msgid "%(cstr)s constraint failed for value %(value)r" +#~ msgstr "el valor %(value)r no satisface la condición %(cstr)s" + +#~ msgid "%(value)r doesn't match the %(regexp)r regular expression" +#~ msgstr "%(value)r no corresponde a la expresión regular %(regexp)r" + #~ msgid "" #~ "Can't restore relation %(rtype)s of entity %(eid)s, this relation does " #~ "not exists anymore in the schema." #~ msgstr "" #~ "No puede restaurar la relación %(rtype)s de la entidad %(eid)s, esta " #~ "relación ya no existe en el esquema." + +#~ msgid "can't change the %s attribute" +#~ msgstr "no puede modificar el atributo %s" + +#~ msgid "can't change this relation" +#~ msgstr "no puede modificar esta relación" + +#~ msgid "incorrect value (%(value)s) for type \"%(type)s\"" +#~ msgstr "valor %(value)s incorrecto para el tipo \"%(type)s\"" + +#~ msgid "invalid value %(value)s, it must be one of %(choices)s" +#~ msgstr "Valor %(value)s incorrecto, debe estar entre %(choices)s" + +#~ msgid "unknown source type" +#~ msgstr "tipo de fuente desconocida" diff -r 41259e1f9d48 -r 001159e2e4f3 i18n/fr.po --- a/i18n/fr.po Fri Nov 09 15:27:40 2012 +0100 +++ b/i18n/fr.po Fri Nov 16 11:41:38 2012 +0100 @@ -50,6 +50,15 @@ "\"role=subject\" ou \"role=object\" doit être specifié dans les options" #, python-format +msgid "%(KEY-cstr)s constraint failed for value %(KEY-value)r" +msgstr "la valeur %(KEY-value)r ne satisfait pas la contrainte %(KEY-cstr)s" + +#, python-format +msgid "%(KEY-value)r doesn't match the %(KEY-regexp)r regular expression" +msgstr "" +"%(KEY-value)r ne correspond pas à l'expression régulière %(KEY-regexp)r" + +#, python-format msgid "%(attr)s set to %(newvalue)s" msgstr "%(attr)s modifié à %(newvalue)s" @@ -58,10 +67,6 @@ msgstr "%(attr)s modifié de %(oldvalue)s à %(newvalue)s" #, python-format -msgid "%(cstr)s constraint failed for value %(value)r" -msgstr "la valeur %(value)r ne satisfait pas la contrainte %(cstr)s" - -#, python-format msgid "%(etype)s by %(author)s" msgstr "%(etype)s par %(author)s" @@ -74,10 +79,6 @@ msgstr "%(subject)s %(etype)s #%(eid)s (%(login)s)" #, python-format -msgid "%(value)r doesn't match the %(regexp)r regular expression" -msgstr "%(value)r ne correspond pas à l'expression régulière %(regexp)r" - -#, python-format msgid "%d days" msgstr "%d jours" @@ -427,6 +428,11 @@ msgid "Click to sort on this column" msgstr "Cliquer pour trier sur cette colonne" +msgid "" +"Configuration of the system source goes to the 'sources' file, not in the " +"database" +msgstr "" + #, python-format msgid "Created %(etype)s : %(entity)s" msgstr "Entité %(etype)s crée : %(entity)s" @@ -900,6 +906,9 @@ msgid "UniqueConstraint" msgstr "contrainte d'unicité" +msgid "Unknown source type" +msgstr "Type de source inconnue" + msgid "Unreachable objects" msgstr "Objets inaccessibles" @@ -960,6 +969,15 @@ "Vous pouvez utiliser n'importe quelle substitution parmi la liste suivante " "dans le contenu de votre courriel." +msgid "You can't change this relation" +msgstr "Vous ne pouvez pas modifier cette relation" + +msgid "You cannot remove the system source" +msgstr "Vous ne pouvez pas supprimer la source système" + +msgid "You cannot rename the system source" +msgstr "Vous ne pouvez pas renommer la source système" + msgid "" "You have no access to this view or it can not be used to display the current " "data." @@ -1301,7 +1319,7 @@ msgstr "mauvaise valeur" msgid "badly formatted url" -msgstr "" +msgstr "URL mal formattée" msgid "base url" msgstr "url de base" @@ -1389,7 +1407,7 @@ msgstr "impossible d'interpréter les types d'entités :" msgid "can only have one url" -msgstr "" +msgstr "ne supporte qu'une seule URL" msgid "can't be changed" msgstr "ne peut-être modifié" @@ -1397,12 +1415,8 @@ msgid "can't be deleted" msgstr "ne peut-être supprimé" -#, python-format -msgid "can't change the %s attribute" -msgstr "ne peut changer l'attribut %s" - -msgid "can't change this relation" -msgstr "ne peut modifier cette relation" +msgid "can't change this attribute" +msgstr "cet attribut ne peut pas être modifié" #, python-format msgid "can't connect to source %s, some data may be missing" @@ -2902,8 +2916,8 @@ msgstr "valeur de captcha incorrecte" #, python-format -msgid "incorrect value (%(value)s) for type \"%(type)s\"" -msgstr "valeur %(value)s incorrecte pour le type \"%(type)s\"" +msgid "incorrect value (%(KEY-value)r) for type \"%(KEY-type)s\"" +msgstr "la valeur %(KEY-value)s est incorrecte pour le type \"%(KEY-type)s\"" msgid "index this attribute's value in the plain text index" msgstr "indexer la valeur de cet attribut dans l'index plein texte" @@ -2982,8 +2996,9 @@ msgstr "action %r invalide" #, python-format -msgid "invalid value %(value)s, it must be one of %(choices)s" -msgstr "valeur %(value)s incorrect, doit être parmi %(choices)s" +msgid "invalid value %(KEY-value)s, it must be one of %(KEY-choices)s" +msgstr "" +"la valeur %(KEY-value)s est incorrecte, elle doit être parmi %(KEY-choices)s" msgid "is" msgstr "de type" @@ -4375,14 +4390,11 @@ msgid "unknown property key %s" msgstr "clé de propriété inconnue : %s" -msgid "unknown source type" -msgstr "type de source inconnu" - msgid "unknown vocabulary:" msgstr "vocabulaire inconnu : " msgid "unsupported protocol" -msgstr "" +msgstr "protocole non supporté" msgid "upassword" msgstr "mot de passe" @@ -4521,27 +4533,23 @@ msgstr "valeur" #, python-format -msgid "value %(value)s must be %(op)s %(boundary)s" -msgstr "la valeur %(value)s doit être %(op)s %(boundary)s" - -#, python-format -msgid "value %(value)s must be <= %(boundary)s" -msgstr "la valeur %(value)s doit être <= %(boundary)s" - -#, python-format -msgid "value %(value)s must be >= %(boundary)s" -msgstr "la valeur %(value)s doit être >= %(boundary)s" +msgid "value %(KEY-value)s must be %(KEY-op)s %(KEY-boundary)s" +msgstr "la valeur %(KEY-value)s n'est pas %(KEY-op)s %(KEY-boundary)s" msgid "value associated to this key is not editable manually" msgstr "la valeur associée à cette clé n'est pas éditable manuellement" #, python-format -msgid "value should have maximum size of %s but found %s" -msgstr "la taille maximum est %s mais cette valeur est de taille %s" +msgid "value should have maximum size of %(KEY-max)s but found %(KEY-size)s" +msgstr "" +"la taille maximum est %(KEY-max)s mais cette valeur est de taille " +"%(KEY-size)s" #, python-format -msgid "value should have minimum size of %s but found %s" -msgstr "la taille minimum est %s mais cette valeur est de taille %s" +msgid "value should have minimum size of %(KEY-min)s but found %(KEY-size)s" +msgstr "" +"la taille minimum est %(KEY-min)s mais cette valeur est de taille " +"%(KEY-size)s" msgid "vcard" msgstr "vcard" diff -r 41259e1f9d48 -r 001159e2e4f3 server/test/unittest_undo.py --- a/server/test/unittest_undo.py Fri Nov 09 15:27:40 2012 +0100 +++ b/server/test/unittest_undo.py Fri Nov 16 11:41:38 2012 +0100 @@ -228,7 +228,7 @@ "%s doesn't exist anymore." % g.eid]) with self.assertRaises(ValidationError) as cm: self.commit() - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.entity, self.toto.eid) self.assertEqual(cm.exception.errors, {'in_group-subject': u'at least one relation in_group is ' diff -r 41259e1f9d48 -r 001159e2e4f3 web/application.py --- a/web/application.py Fri Nov 09 15:27:40 2012 +0100 +++ b/web/application.py Fri Nov 16 11:41:38 2012 +0100 @@ -510,7 +510,7 @@ return '' def validation_error_handler(self, req, ex): - ex.tr(req._) # translate messages using ui language + ex.translate(req._) # translate messages using ui language if '__errorurl' in req.form: forminfo = {'error': ex, 'values': req.form, diff -r 41259e1f9d48 -r 001159e2e4f3 web/test/unittest_views_basecontrollers.py --- a/web/test/unittest_views_basecontrollers.py Fri Nov 09 15:27:40 2012 +0100 +++ b/web/test/unittest_views_basecontrollers.py Fri Nov 16 11:41:38 2012 +0100 @@ -77,7 +77,7 @@ } with self.assertRaises(ValidationError) as cm: self.ctrl_publish(req) - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.errors, {'login-subject': 'the value "admin" is already used, use another one'}) def test_user_editing_itself(self): @@ -250,7 +250,7 @@ } with self.assertRaises(ValidationError) as cm: self.ctrl_publish(req) - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.errors, {'amount-subject': 'value -10 must be >= 0'}) req = self.request(rollbackfirst=True) req.form = {'eid': ['X'], @@ -261,7 +261,7 @@ } with self.assertRaises(ValidationError) as cm: self.ctrl_publish(req) - cm.exception.tr(unicode) + cm.exception.translate(unicode) self.assertEqual(cm.exception.errors, {'amount-subject': 'value 110 must be <= 100'}) req = self.request(rollbackfirst=True) req.form = {'eid': ['X'], diff -r 41259e1f9d48 -r 001159e2e4f3 web/views/basecontrollers.py --- a/web/views/basecontrollers.py Fri Nov 09 15:27:40 2012 +0100 +++ b/web/views/basecontrollers.py Fri Nov 16 11:41:38 2012 +0100 @@ -190,7 +190,7 @@ def _validation_error(req, ex): req.cnx.rollback() - ex.tr(req._) # translate messages using ui language + ex.translate(req._) # translate messages using ui language # XXX necessary to remove existant validation error? # imo (syt), it's not necessary req.session.data.pop(req.form.get('__errorurl'), None)