[PATCH eac V2] Add support for <languageDeclaration>

Denis Laxalde denis.laxalde at logilab.fr
Tue Aug 6 10:22:03 CEST 2019


Guillaume Vandevelde a écrit :
> # HG changeset patch
> # User Guillaume Vandevelde <gvandevelde at logilab.fr>
> # Date 1564500696 -7200
> #      Tue Jul 30 17:31:36 2019 +0200
> # Node ID 2b7e9259c9e4219929082061e8914878ea811309
> # Parent  29a224db521a3644469c44173b2973bb398e0f12
> # Available At http://hg.logilab.org/review/cubes/eac
> #              hg pull http://hg.logilab.org/review/cubes/eac -r 2b7e9259c9e4
> Add support for <languageDeclaration>
> 
> Basic adding of a new entity: `LanguageDec`.
> It is added as a child of AuthorityRecord.

Can you update the commit message and make it understandable?

> diff -r 29a224db521a -r 2b7e9259c9e4 cubicweb_eac/i18n/fr.po
> --- a/cubicweb_eac/i18n/fr.po	Fri Aug 02 10:20:36 2019 +0200
> +++ b/cubicweb_eac/i18n/fr.po	Tue Jul 30 17:31:36 2019 +0200
> @@ -1610,3 +1610,47 @@
>  msgctxt "HierarchicalRelation"
>  msgid "xml_wrap"
>  msgstr ""
> +
> +msgid "LanguageDeclaration"
> +msgstr "langage déclaré"

I think the proper french translation would be "langue".

> +
> +msgid "LanguageDeclaration_plural"
> +msgstr "langages déclarés"
> +
> +msgid "New LanguageDeclaration"
> +msgstr "nouveau langage déclaré"
> +
> +msgid "This LanguageDeclaration"
> +msgstr "ce langage déclaré"
> +
> +msgid "This LanguageDeclaration:"
> +msgstr "ce langage déclaré :"
> +
> +msgid "language"
> +msgstr "langage"
> +
> +msgid "add a LanguageDeclaration"
> +msgstr "ajouter un language"
> +
> +msgid "language_declaration_of"
> +msgstr "language déclaré de"
> +
> +msgctxt "LanguageDeclaration"
> +msgid "language_declaration_of"
> +msgstr ""
> +
> +msgid "language_declaration_of_object"
> +msgstr "language déclaré de cet objet"
> +
> +msgctxt "AuthorityRecord"
> +msgid "language_declaration_of_object"
> +msgstr "language déclaré de cette notice"
> +
> +msgid ""
> +"creating LanguageDeclaration (LanguageDeclaration language_declaration_of AuthorityRecord %(linkto)s)"
> +msgstr ""
> +
> +msgctxt "LanguageDeclaration"
> +msgid "description"
> +msgstr ""
> +


> diff -r 29a224db521a -r 2b7e9259c9e4 test/test_dataimport.py
> --- a/test/test_dataimport.py	Fri Aug 02 10:20:36 2019 +0200
> +++ b/test/test_dataimport.py	Tue Jul 30 17:31:36 2019 +0200

> @@ -549,7 +559,8 @@
>              self.assertEqual(len(record.reverse_function_agent), 3)
>              for related in ('structure', 'history', 'mandate', 'occupation',
>                              'generalcontext', 'legal_status', 'eac_relations',
> -                            'equivalent_concept', 'control', 'convention'):
> +                            'equivalent_concept', 'control', 'convention',
> +                            'language_declaration'):
>                  with self.subTest(related=related):
>                      checker = getattr(self, '_check_' + related)
>                      checker(cnx, record)
> @@ -569,6 +580,18 @@
>                           u'Norme ISAAR(CPF) du Conseil international des archives, '
>                           u'2e \xe9dition, 1996.')
>  
> +    def _check_language_declaration(self, cnx, record):
> +        rset = cnx.find('LanguageDeclaration', language_declaration_of=record)
> +        self.assertEqual(len(rset), 1)
> +        self.assertEqual(rset.one().printable_value('language', format=u'text/plain').strip(),
> +                         u'<language xmlns="urn:isbn:1-931666-33-4" xmlns:xsi="http://www.w3'
> +                         u'.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999'
> +                         u'/xlink" languageCode="fre">français</language>')
> +        self.assertEqual(rset.one().printable_value('script', format=u'text/plain').strip(),

I'd suggest to add an intermediate variable "entity = rset.one()" to
avoid calling .one() twice.

> +                         u'<script xmlns="urn:isbn:1-931666-33-4" xmlns:xsi="http://www.w3.org'
> +                         u'/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink"'
> +                         u' scriptCode="Latn">latin</script>')
> +
>      def _check_history(self, cnx, record):
>          rset = cnx.find('History', history_agent=record)
>          self.assertEqual(len(rset), 1)



More information about the saem-devel mailing list