[vocabularies] Fix seda languages for the MIME type vocabulary
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Aug 2017 15:33:06 +0200
changeset 2660 12ff9f4270d1
parent 2658 2849b0757245
child 2661 21de2d5db256
[vocabularies] Fix seda languages for the MIME type vocabulary Values are not SEDA 2 specific, they should be used for every SEDA version, so change 'SEDA-2' into 'SEDA' else the english value is used for SEDA 1.0 and 0.2. Closes extranet #32206261
cubicweb_seda/migration/0.10.6_Any.py
cubicweb_seda/migration/data/mime_types.csv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cubicweb_seda/migration/0.10.6_Any.py	Wed Aug 16 15:33:06 2017 +0200
@@ -0,0 +1,10 @@
+scheme = cnx.find('ConceptScheme', title=u'Types MIME').one()
+sql("""
+UPDATE cw_label SET cw_language_code = 'seda'
+FROM cw_concept, in_scheme_relation
+WHERE in_scheme_relation.eid_to = {}
+AND cw_concept.cw_eid = in_scheme_relation.eid_from
+AND cw_label_of = cw_concept.cw_eid
+AND cw_language_code = 'seda-2'
+""".format(scheme.eid))
+
--- a/cubicweb_seda/migration/data/mime_types.csv	Thu Jul 20 16:12:36 2017 +0200
+++ b/cubicweb_seda/migration/data/mime_types.csv	Wed Aug 16 15:33:06 2017 +0200
@@ -1,6 +1,6 @@
-#;$id;libellé SEDA 2;libellé anglais
+#;$id;libellé SEDA;libellé anglais
 type;url;string;string
-lang;;seda-2;en
+lang;;seda;en
 url;skos:Concept;skos:prefLabel;skos:prefLabel
 ;;application/1d-interleaved-parityfec;1d-interleaved-parityfec
 ;;application/3gpp-ims+xml;3gpp-ims+xml