Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/380897 )
Change subject: AdaptationTest: Actually test that the output is correct ...................................................................... AdaptationTest: Actually test that the output is correct These tests only tested that the adaptation process didn't error out and returned a non-empty result. Now they also test that the result is what we expect it to be. Because the result contains data-cx blobs which are quite large (due to embedded titleInfo for links), embed those in the test data separately for readability, and add some code to inject them back in by ID. Also fix the test cases to assert the correct outcome, mostly around link titles (the title attribute of an adapted link is equal to the adapted href, not the unadapted one). Change-Id: I12a723732b87c20d09967755ddb85182ee1ea9c3 --- M test/adaptation/AdaptationTest.js M test/adaptation/AdaptationTests.json 2 files changed, 166 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver refs/changes/97/380897/1 diff --git a/test/adaptation/AdaptationTest.js b/test/adaptation/AdaptationTest.js index 4154cfe..04691c2 100644 --- a/test/adaptation/AdaptationTest.js +++ b/test/adaptation/AdaptationTest.js @@ -1,11 +1,12 @@ 'use strict'; -const assert = require( '../utils/assert.js' ), +const assert = require( 'assert' ), server = require( '../utils/server.js' ), async = require( 'async' ), Apertium = require( '../../lib/mt' ).Apertium, Adapter = require( '../../lib/Adapter' ), - tests = require( './AdaptationTests.json' ); + tests = require( './AdaptationTests.json' ), + jsdom = require( 'jsdom' ); describe( 'Adaptation tests', () => { async.forEach( tests, ( test ) => { @@ -14,9 +15,27 @@ cxserver = server.config.conf.services[ server.config.conf.services.length - 1 ]; cxserver.conf.mtClient = new Apertium( cxserver ); adapter = new Adapter( test.from, test.to, cxserver ); - it( 'should not have any errors when: ' + test.desc, () => { + it( test.desc, () => { + let expectedDom = new jsdom.JSDOM( test.result ); + // Put data-cx in + if ( test[ 'data-cx' ] ) { + for ( let id in test[ 'data-cx' ] ) { + expectedDom.window.document.getElementById( id ) + .setAttribute( 'data-cx', JSON.stringify( test[ 'data-cx' ][ id ] ) ); + } + } + return adapter.adapt( test.source ).then( ( result ) => { - assert.ok( result.getHtml().length > 0 ); + let actualDom = new jsdom.JSDOM( result.getHtml() ); + if ( actualDom.window.document.body.isEqualNode( expectedDom.window.document.body ) ) { + assert.ok( true, test.desc ); + } else { + assert.equal( + actualDom.window.document.body.outerHTML, + expectedDom.window.document.body.outerHTML, + test.desc + ); + } } ); } ); } ); diff --git a/test/adaptation/AdaptationTests.json b/test/adaptation/AdaptationTests.json index 47031c1..3d7d0af 100644 --- a/test/adaptation/AdaptationTests.json +++ b/test/adaptation/AdaptationTests.json @@ -3,36 +3,171 @@ "desc": "Link adaptation basic test", "from": "en", "to": "es", - "source": "<p><a rel='mw:WikiLink' href='Oxygen'>Oxygen</a> is a chemical element with symbol O and <a rel='mw:WikiLink' href='Atomic number'>atomic number</a> 8.</p>", - "result": "<p><a href='Oxígeno' rel='mw:WikiLink'>Oxygen</a> is a chemical element with symbol O and <a href='Número atómico' rel='mw:WikiLink'>atomic number</a> 8.</p>" + "source": "<p><a rel='mw:WikiLink' href='Oxygen' id='mwAA'>Oxygen</a> is a chemical element with symbol O and <a rel='mw:WikiLink' href='Atomic number' id='mwAB'>atomic number</a> 8.</p>", + "result": "<p><a rel='mw:WikiLink' href='Oxígeno' id='mwAA' title='Oxígeno'>Oxygen</a> is a chemical element with symbol O and <a rel='mw:WikiLink' href='Número atómico' id='mwAB' title='Número atómico'>atomic number</a> 8.</p>", + "data-cx": { + "mwAA": { + "adapted": true, + "targetTitle": { + "title": "Oxígeno", + "pagelanguage": "es", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/O%2C8.jpg/80px-O%2C8.jpg", + "width": 80, + "height": 40 + }, + "terms": { + "description": [ "elemento químico", "elemento químico" ] + } + }, + "sourceTitle": { + "title": "Oxygen", + "pagelanguage": "en", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Liquid_oxygen_in_a_beaker_4.jpg/66px-Liquid_oxygen_in_a_beaker_4.jpg", + "width": 66, + "height": 80 + }, + "terms": { + "description": [ "element with the atomic number of 8", "element with the atomic number of 8" ] + } + } + }, + "mwAB": { + "adapted": true, + "targetTitle": { + "title": "Número atómico", + "pagelanguage": "es", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Element_identity.png/80px-Element_identity.png", + "width": 80, + "height": 80 + }, + "terms": { + "description": [ "número total de protones que tiene el átomo", "número total de protones que tiene el átomo" ] + } + }, + "sourceTitle": { + "title": "Atomic number", + "pagelanguage": "en", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Atomic_number_depiction.jpg/80px-Atomic_number_depiction.jpg", + "width": 80, + "height": 49 + }, + "terms": { + "description": [ "number of protons found in the nucleus of an atom", "number of protons found in the nucleus of an atom" ] + } + } + } + } }, { "desc": "Link adaptation - Full paragraph and relative links", "from": "en", "to": "es", - "source": "<p id='mwBg'><b id='mwBw'>Oxygen</b> is a <a rel='mw:WikiLink' href='./Chemical_element' title='Chemical element' id='mwCA'>chemical element</a> with symbol<span typeof='mw:Entity' id='mwCQ'> </span><b id='mwCg'>O</b> and <a rel='mw:WikiLink' href='./Atomic_number' title='Atomic number' id='mwCw'>atomic number</a> 8. It is a member of the <a rel='mw:WikiLink' href='./Chalcogen' title='Chalcogen' id='mwDA'>chalcogen</a> <a rel='mw:WikiLink' href='./Group_(periodic_table)' title='Group (periodic table)' id='mwDQ'>group</a> on the <a rel='mw:WikiLink' href='./Periodic_table' title='Periodic table' id='mwDg'>periodic table</a> and is a highly <a rel='mw:WikiLink' href='./Chemical_reaction' title='Chemical reaction' id='mwDw'>reactive</a> <a rel='mw:WikiLink' href='./Nonmetal' title='Nonmetal' id='mwEA'>nonmetal</a> and <a rel='mw:WikiLink' href='./Oxidizing_agent' title='Oxidizing agent' id='mwEQ'>oxidizing agent</a> that readily forms <a rel='mw:WikiLink' href='./Oxide' title='Oxide' id='mwEg'>oxides</a> with most elements as well as other <a rel='mw:WikiLink' href='./Chemical_compound' title='Chemical compound' id='mwEw'>compounds</a>. By mass, oxygen is the third-<a rel='mw:WikiLink' href='./Abundance_of_the_chemical_elements' title='Abundance of the chemical elements' id='mwFA'>most abundant element</a> in the universe, after <a rel='mw:WikiLink' href='./Hydrogen' title='Hydrogen' id='mwFQ'>hydrogen</a> and <a rel='mw:WikiLink' href='./Helium' title='Helium' id='mwFg'>helium</a>. At <a rel='mw:WikiLink' href='./Standard_temperature_and_pressure' title='Standard temperature and pressure' id='mwFw' class='mw-redirect'>standard temperature and pressure</a>, two atoms of the element <a rel='mw:WikiLink' href='./Chemical_bond' title='Chemical bond' id='mwGA'>bind</a> to form <a rel='mw:WikiLink' href='./Allotropes_of_oxygen#Dioxygen' title='Allotropes of oxygen' id='mwGQ'>dioxygen</a>, a colorless and odorless <a rel='mw:WikiLink' href='./Diatomic_molecule' title='Diatomic molecule' id='mwGg'>diatomic</a> <a rel='mw:WikiLink' href='./Gas' title='Gas' id='mwGw'>gas</a> with the formula. This is an important part of the <a rel='mw:WikiLink' href='./Atmosphere_of_Earth' title='Atmosphere of Earth' id='mwHQ'>atmosphere</a> and diatomic oxygen gas constitutes 20.8% of the <a rel='mw:WikiLink' href='./Earth's_atmosphere' title='Earth's atmosphere' id='mwHg' class='mw-redirect'>Earth's atmosphere</a>. Additionally, as oxides the element makes up almost half of the <a rel='mw:WikiLink' href='./Earth's_crust' title='Earth's crust' id='mwHw' class='mw-redirect'>Earth's crust</a>.</p>", - "result": "<p id='mwBg'><b id='mwBw'>Oxygen</b> is a <a href='Elemento químico' id='mwCA' rel='mw:WikiLink' title='Chemical element'>chemical element</a> with symbol<span id='mwCQ' typeof='mw:Entity'> </span><b id='mwCg'>O</b> and <a href='Número atómico' id='mwCw' rel='mw:WikiLink' title='Atomic number'>atomic number</a> 8. It is a member of the <a href='Anfígeno' id='mwDA' rel='mw:WikiLink' title='Chalcogen'>chalcogen</a> <a data-cx='{"adapted":false,"sourceTitle":"Group (periodic table)"}' href='./Group_(periodic_table)' id='mwDQ' rel='mw:WikiLink' title='Group (periodic table)'>group</a> on the <a href='Tabla periódica de los elementos' id='mwDg' rel='mw:WikiLink' title='Periodic table'>periodic table</a> and is a highly <a href='Reacción química' id='mwDw' rel='mw:WikiLink' title='Chemical reaction'>reactive</a> <a href='No metal' id='mwEA' rel='mw:WikiLink' title='Nonmetal'>nonmetal</a> and <a href='Oxidante' id='mwEQ' rel='mw:WikiLink' title='Oxidizing agent'>oxidizing agent</a> that readily forms <a href='Óxido' id='mwEg' rel='mw:WikiLink' title='Oxide'>oxides</a> with most elements as well as other <a href='Compuesto químico' id='mwEw' rel='mw:WikiLink' title='Chemical compound'>compounds</a>. By mass, oxygen is the third-<a href='Abundancia de los elementos químicos' id='mwFA' rel='mw:WikiLink' title='Abundance of the chemical elements'>most abundant element</a> in the universe, after <a href='Hidrógeno' id='mwFQ' rel='mw:WikiLink' title='Hydrogen'>hydrogen</a> and <a href='Helio' id='mwFg' rel='mw:WikiLink' title='Helium'>helium</a>. At <a class='mw-redirect' href='Condiciones normalizadas de presión y temperatura' id='mwFw' rel='mw:WikiLink' title='Standard temperature and pressure'>standard temperature and pressure</a>, two atoms of the element <a href='Enlace químico' id='mwGA' rel='mw:WikiLink' title='Chemical bond'>bind</a> to form <a href='Alótropos del oxígeno' id='mwGQ' rel='mw:WikiLink' title='Allotropes of oxygen'>dioxygen</a>, a colorless and odorless <a href='Molécula diatómica' id='mwGg' rel='mw:WikiLink' title='Diatomic molecule'>diatomic</a> <a href='Gas' id='mwGw' rel='mw:WikiLink' title='Gas'>gas</a> with the formula. This is an important part of the <a href='Atmósfera terrestre' id='mwHQ' rel='mw:WikiLink' title='Atmosphere of Earth'>atmosphere</a> and diatomic oxygen gas constitutes 20.8% of the <a atmosphere='' class='mw-redirect' href='Tierra' id='mwHg' rel='mw:WikiLink' s='' s_atmosphere='' title='Earth'>Earth's atmosphere</a>. Additionally, as oxides the element makes up almost half of the <a class='mw-redirect' crust='' href='Tierra' id='mwHw' rel='mw:WikiLink' s='' s_crust='' title='Earth'>Earth's crust</a>.</p>" + "source": "<p id='mwBg'><b id='mwBw'>Oxygen</b> is a <a rel='mw:WikiLink' href='./Chemical_element' title='Chemical element' id='mwCA'>chemical element</a> with symbol<span typeof='mw:Entity' id='mwCQ'> </span><b id='mwCg'>O</b> and <a rel='mw:WikiLink' href='./Atomic_number' title='Atomic number' id='mwCw'>atomic number</a> 8. It is a member of the <a rel='mw:WikiLink' href='./Chalcogen' title='Chalcogen' id='mwDA'>chalcogen</a> <a rel='mw:WikiLink' href='./Group_(periodic_table)' title='Group (periodic table)' id='mwDQ'>group</a> on the <a rel='mw:WikiLink' href='./Periodic_table' title='Periodic table' id='mwDg'>periodic table</a> and is a highly <a rel='mw:WikiLink' href='./Chemical_reaction' title='Chemical reaction' id='mwDw'>reactive</a> <a rel='mw:WikiLink' href='./Nonmetal' title='Nonmetal' id='mwEA'>nonmetal</a> and <a rel='mw:WikiLink' href='./Oxidizing_agent' title='Oxidizing agent' id='mwEQ'>oxidizing agent</a> that readily forms <a rel='mw:WikiLink' href='./Oxide' title='Oxide' id='mwEg'>oxides</a> with most elements as well as other <a rel='mw:WikiLink' href='./Chemical_compound' title='Chemical compound' id='mwEw'>compounds</a>. By mass, oxygen is the third-<a rel='mw:WikiLink' href='./Abundance_of_the_chemical_elements' title='Abundance of the chemical elements' id='mwFA'>most abundant element</a> in the universe, after <a rel='mw:WikiLink' href='./Hydrogen' title='Hydrogen' id='mwFQ'>hydrogen</a> and <a rel='mw:WikiLink' href='./Helium' title='Helium' id='mwFg'>helium</a>. At <a rel='mw:WikiLink' href='./Standard_temperature_and_pressure' title='Standard temperature and pressure' id='mwFw' class='mw-redirect'>standard temperature and pressure</a>, two atoms of the element <a rel='mw:WikiLink' href='./Chemical_bond' title='Chemical bond' id='mwGA'>bind</a> to form <a rel='mw:WikiLink' href='./Allotropes_of_oxygen#Dioxygen' title='Allotropes of oxygen' id='mwGQ'>dioxygen</a>, a colorless and odorless <a rel='mw:WikiLink' href='./Diatomic_molecule' title='Diatomic molecule' id='mwGg'>diatomic</a> <a rel='mw:WikiLink' href='./Gas' title='Gas' id='mwGw'>gas</a> with the formula. This is an important part of the <a rel='mw:WikiLink' href='./Atmosphere_of_Earth' title='Atmosphere of Earth' id='mwHQ'>atmosphere</a> and diatomic oxygen gas constitutes 20.8% of the <a rel='mw:WikiLink' href=\"./Earth's_atmosphere\" title=\"Earth's atmosphere\" id='mwHg' class='mw-redirect'>Earth's atmosphere</a>. Additionally, as oxides the element makes up almost half of the <a rel='mw:WikiLink' href=\"./Earth's_crust\" title=\"Earth's crust\" id='mwHw' class='mw-redirect'>Earth's crust</a>.</p>", + "result": "<p id='mwBg'><b id='mwBw'>Oxygen</b> is a <a href='Elemento químico' id='mwCA' rel='mw:WikiLink' title='Elemento químico'>chemical element</a> with symbol<span id='mwCQ' typeof='mw:Entity'> </span><b id='mwCg'>O</b> and <a href='Número atómico' id='mwCw' rel='mw:WikiLink' title='Número atómico'>atomic number</a> 8. It is a member of the <a href='Anfígeno' id='mwDA' rel='mw:WikiLink' title='Anfígeno'>chalcogen</a> <a href='./Group_(periodic_table)' id='mwDQ' rel='mw:WikiLink' title='Group (periodic table)'>group</a> on the <a href='Tabla periódica de los elementos' id='mwDg' rel='mw:WikiLink' title='Tabla periódica de los elementos'>periodic table</a> and is a highly <a href='Reacción química' id='mwDw' rel='mw:WikiLink' title='Reacción química'>reactive</a> <a href='No metal' id='mwEA' rel='mw:WikiLink' title='No metal'>nonmetal</a> and <a href='Oxidante' id='mwEQ' rel='mw:WikiLink' title='Oxidante'>oxidizing agent</a> that readily forms <a href='Óxido' id='mwEg' rel='mw:WikiLink' title='Óxido'>oxides</a> with most elements as well as other <a href='Compuesto químico' id='mwEw' rel='mw:WikiLink' title='Compuesto químico'>compounds</a>. By mass, oxygen is the third-<a href='Abundancia de los elementos químicos' id='mwFA' rel='mw:WikiLink' title='Abundancia de los elementos químicos'>most abundant element</a> in the universe, after <a href='Hidrógeno' id='mwFQ' rel='mw:WikiLink' title='Hidrógeno'>hydrogen</a> and <a href='Helio' id='mwFg' rel='mw:WikiLink' title='Helio'>helium</a>. At <a class='mw-redirect' href='Condiciones normalizadas de presión y temperatura' id='mwFw' rel='mw:WikiLink' title='Condiciones normalizadas de presión y temperatura'>standard temperature and pressure</a>, two atoms of the element <a href='Enlace químico' id='mwGA' rel='mw:WikiLink' title='Enlace químico'>bind</a> to form <a href='Alótropos del oxígeno' id='mwGQ' rel='mw:WikiLink' title='Alótropos del oxígeno'>dioxygen</a>, a colorless and odorless <a href='Molécula diatómica' id='mwGg' rel='mw:WikiLink' title='Molécula diatómica'>diatomic</a> <a href='Gas' id='mwGw' rel='mw:WikiLink' title='Gas'>gas</a> with the formula. This is an important part of the <a href='Atmósfera terrestre' id='mwHQ' rel='mw:WikiLink' title='Atmósfera terrestre'>atmosphere</a> and diatomic oxygen gas constitutes 20.8% of the <a class='mw-redirect' href='Atmósfera terrestre' id='mwHg' rel='mw:WikiLink' title='Atmósfera terrestre'>Earth's atmosphere</a>. Additionally, as oxides the element makes up almost half of the <a class='mw-redirect' href='Corteza terrestre' id='mwHw' rel='mw:WikiLink' title='Corteza terrestre'>Earth's crust</a>.</p>", + "data-cx": { + "mwCA": { + "adapted": true, + "targetTitle": { + "title": "Elemento químico", + "pagelanguage": "es", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/Periodic_table_large_2016-es.png/80px-Periodic_table_large_2016-es.png", + "width": 80, + "height": 44 + }, + "terms": { + "description": [ "tipo de materia constituida por átomos de la misma clase" ] + } + }, + "sourceTitle": { + "title": "Chemical element", + "pagelanguage": "en", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Periodic_Table_Chart.png/80px-Periodic_Table_Chart.png", + "width": 80, + "height": 43 + }, + "terms": { + "description": [ "each instance has the same specified number of protons in its atomic nucleus, and is itself also a class" ] + } + } + }, + "mwCw": {"adapted":true,"targetTitle":{"title":"Número atómico","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Element_identity.png/80px-Element_identity.png","width":80,"height":80},"terms":{"description":["número total de protones que tiene el átomo","número total de protones que tiene el átomo"]}},"sourceTitle":{"title":"Atomic number","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Atomic_number_depiction.jpg/80px-Atomic_number_depiction.jpg","width":80,"height":49},"terms":{"description":["number of protons found in the nucleus of an atom","number of protons found in the nucleus of an atom"]}}}, + "mwDA": {"adapted":true,"targetTitle":{"title":"Anfígeno","pagelanguage":"es"},"sourceTitle":{"title":"Chalcogen","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/4/44/Sulfur-sample.jpg/80px-Sulfur-sample.jpg","width":80,"height":60},"terms":{"description":["group of chemical elements"]}}}, + "mwDQ": { + "adapted": false, + "sourceTitle": { + "title": "Group (periodic table)", + "pagelanguage": "en", + "thumbnail": { + "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Periodic_Table_Chart.png/80px-Periodic_Table_Chart.png", + "width": 80, + "height": 43 + }, + "terms": { + "description": [ "column of elements in the periodic table of the chemical elements" ] + } + } + }, + "mwDg": {"adapted":true,"targetTitle":{"title":"Tabla periódica de los elementos","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Tabla_periodica.png/80px-Tabla_periodica.png","width":80,"height":43},"terms":{"description":["tabla que clasifica, organiza y distribuye los distintos elementos químicos, conforme a sus propiedades y características","tabla que clasifica, organiza y distribuye los distintos elementos químicos, conforme a sus propiedades y características"]}},"sourceTitle":{"title":"Periodic table","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Simple_Periodic_Table_Chart-en.svg/80px-Simple_Periodic_Table_Chart-en.svg.png","width":80,"height":42},"terms":{"description":["tabular display of the chemical elements","tabular display of the chemical elements"]}}}, + "mwDw": {"adapted":true,"targetTitle":{"title":"Reacción química","pagelanguage":"es","terms":{"description":["proceso termodinámico en el cual una o más sustancias químicas son transformadas"]}},"sourceTitle":{"title":"Chemical reaction","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/ThermiteReaction.jpg/72px-ThermiteReaction.jpg","width":72,"height":80},"terms":{"description":["process that leads to the transformation of one set of chemical substances to another; encompass changes that only involve the positions of electrons in the forming and breaking of chemical bonds between atoms, with no change to the nuclei"]}}}, + "mwEA": {"adapted":true,"targetTitle":{"title":"No metal","pagelanguage":"es","terms":{"description":["categoría de elementos químicos opuestos a los metales","categoría de elementos químicos opuestos a los metales"]}},"sourceTitle":{"title":"Nonmetal","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Periodic_Table_Chart.png/80px-Periodic_Table_Chart.png","width":80,"height":43},"terms":{"description":["term to classify chemical elements","term to classify chemical elements"]}}}, + "mwEQ": {"adapted":true,"targetTitle":{"title":"Oxidante","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Hazard_O.svg/80px-Hazard_O.svg.png","width":80,"height":80},"terms":{"description":["compuesto químico que oxida a otra sustancia"]}},"sourceTitle":{"title":"Oxidizing agent","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/GHS-pictogram-rondflam.svg/80px-GHS-pictogram-rondflam.svg.png","width":80,"height":80},"terms":{"description":["chemical compound used to oxidize another substance in a chemical reaction"]}}}, + "mwEg": {"adapted":true,"targetTitle":{"title":"Óxido","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Oxid_door.jpg/80px-Oxid_door.jpg","width":80,"height":60},"terms":{"description":["compuesto binario que contiene uno o varios átomos de oxígeno y otros elementos"]}},"sourceTitle":{"title":"Oxide","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/A-quartz.png/80px-A-quartz.png","width":80,"height":73},"terms":{"description":["chemical compound with at least one oxygen atom"]}}}, + "mwEw": {"adapted":true,"targetTitle":{"title":"Compuesto químico","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/LightningVolt_Deep_Blue_Sea.jpg/64px-LightningVolt_Deep_Blue_Sea.jpg","width":64,"height":80},"terms":{"description":["sustancia química formada por la unión de dos o más elementos de la tabla periódica"]}},"sourceTitle":{"title":"Chemical compound","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/2006-02-13_Drop-impact.jpg/80px-2006-02-13_Drop-impact.jpg","width":80,"height":77},"terms":{"description":["pure chemical substance consisting of two or more different chemical elements"]}}}, + "mwFA": {"adapted":true,"targetTitle":{"title":"Abundancia de los elementos químicos","pagelanguage":"es"},"sourceTitle":{"title":"Abundance of the chemical elements","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Universe_content_bar_chart.svg/80px-Universe_content_bar_chart.svg.png","width":80,"height":52}}}, + "mwFQ": {"adapted":true,"targetTitle":{"title":"Hidrógeno","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/9/94/H%2C1.jpg/80px-H%2C1.jpg","width":80,"height":44},"terms":{"description":["elemento químico con número atómico 1"]}},"sourceTitle":{"title":"Hydrogen","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Hydrogen_discharge_tube.jpg/80px-Hydrogen_discharge_tube.jpg","width":80,"height":27},"terms":{"description":["chemical element with symbol H and atomic number 1"]}}}, + "mwFg": {"adapted":true,"targetTitle":{"title":"Helio","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c8/He%2C2.jpg/80px-He%2C2.jpg","width":80,"height":40},"terms":{"description":["elemento químico"]}},"sourceTitle":{"title":"Helium","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/8/82/Helium_discharge_tube.jpg/80px-Helium_discharge_tube.jpg","width":80,"height":53},"terms":{"description":["chemical element with the chemical symbol He and the atomic number of 2"]}}}, + "mwFw": {"adapted":true,"targetTitle":{"title":"Condiciones normalizadas de presión y temperatura","pagelanguage":"es","terms":{"description":["valores de presión atmosférica y temperatura que imperan en un laboratorio","valores de presión atmosférica y temperatura que imperan en un laboratorio"]}},"sourceTitle":{"title":"Standard conditions for temperature and pressure","pagelanguage":"en"}}, + "mwGA": {"adapted":true,"targetTitle":{"title":"Enlace químico","pagelanguage":"es","terms":{"description":["proceso químico responsable de las interacciones atractivas entre átomos y moléculas","proceso químico responsable de las interacciones atractivas entre átomos y moléculas"]}},"sourceTitle":{"title":"Chemical bond","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Electron_dot.svg/80px-Electron_dot.svg.png","width":80,"height":65},"terms":{"description":["lasting attraction between atoms that enables the formation of chemical compounds","lasting attraction between atoms that enables the formation of chemical compounds"]}}}, + "mwGQ": {"adapted":true,"targetTitle":{"title":"Alótropos del oxígeno","pagelanguage":"es"},"sourceTitle":{"title":"Allotropes of oxygen","pagelanguage":"en"}}, + "mwGg": {"adapted":true,"targetTitle":{"title":"Molécula diatómica","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/Nitrogeno_-Molecular-.jpg/80px-Nitrogeno_-Molecular-.jpg","width":80,"height":76}},"sourceTitle":{"title":"Diatomic molecule","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Nitrogen-3D-vdW.png/80px-Nitrogen-3D-vdW.png","width":80,"height":61},"terms":{"description":["molecule composed of only two atoms of the same or different chemical elements"]}}}, + "mwGw": {"adapted":true,"targetTitle":{"title":"Gas","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Translational_motion.gif/80px-Translational_motion.gif","width":80,"height":70},"terms":{"description":["estado de la materia"]}},"sourceTitle":{"title":"Gas","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Gas_particle_movement.svg/80px-Gas_particle_movement.svg.png","width":80,"height":57},"terms":{"description":["gaseous object"]}}}, + "mwHQ": {"adapted":true,"targetTitle":{"title":"Atmósfera terrestre","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Full_moon_partially_obscured_by_atmosphere.jpg/80px-Full_moon_partially_obscured_by_atmosphere.jpg","width":80,"height":53},"terms":{"description":["parte gaseosa de la Tierra","parte gaseosa de la Tierra"]}},"sourceTitle":{"title":"Atmosphere of Earth","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Top_of_Atmosphere.jpg/80px-Top_of_Atmosphere.jpg","width":80,"height":53},"terms":{"description":["layer of gases surrounding the planet Earth","layer of gases surrounding the planet Earth"]}}}, + "mwHg": {"adapted":true,"targetTitle":{"title":"Atmósfera terrestre","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Full_moon_partially_obscured_by_atmosphere.jpg/80px-Full_moon_partially_obscured_by_atmosphere.jpg","width":80,"height":53},"terms":{"description":["parte gaseosa de la Tierra","parte gaseosa de la Tierra"]}},"sourceTitle":{"title":"Atmosphere of Earth","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/b/be/Top_of_Atmosphere.jpg/80px-Top_of_Atmosphere.jpg","width":80,"height":53},"terms":{"description":["layer of gases surrounding the planet Earth","layer of gases surrounding the planet Earth"]}}}, + "mwHw": {"adapted":true,"targetTitle":{"title":"Corteza terrestre","pagelanguage":"es","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Earth-crust-cutaway-spanish.svg/80px-Earth-crust-cutaway-spanish.svg.png","width":80,"height":62},"terms":{"description":["capa rocosa más externa de la Tierra"]}},"sourceTitle":{"title":"Crust (geology)","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/World_geologic_provinces.jpg/80px-World_geologic_provinces.jpg","width":80,"height":42},"terms":{"description":["crust"]}}} + } }, { "desc": "Image adaptation basic test", "from": "en", "to": "ru", "source": "<figure class='mw-default-size mw-halign-left' typeof='mw:Image/Thumb' id='mwUQ'><a href='./File:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' resource='./File:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' data-file-width='125' data-file-height='248' data-file-type='bitmap' height='248' width='125' id='mwUw'/></a><figcaption id='mwVA'><a rel='mw:WikiLink' href='./Philo_of_Byzantium' title='Philo of Byzantium' id='mwVQ'>Philo's</a> experiment inspired later <a rel='mw:WikiLink' href='./Detective' title='Detective' id='mwVg'>investigators</a>.</figcaption></figure>", - "result": "<figure class='mw-default-size mw-halign-left' id='mwUQ' typeof='mw:Image/Thumb'><a href='./Файл:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./Файл:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a href='Филон Византийский' id='mwVQ' rel='mw:WikiLink' title='Philo of Byzantium'>Philo's</a> experiment inspired later <a href='Детектив (профессия)' id='mwVg' rel='mw:WikiLink' title='Detective'>investigators</a>.</figcaption></figure>" + "result": "<figure class='mw-default-size mw-halign-left' id='mwUQ' typeof='mw:Image/Thumb'><a href='./Файл:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./Файл:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a href='Филон Византийский' id='mwVQ' rel='mw:WikiLink' title='Филон Византийский'>Philo's</a> experiment inspired later <a href='Детектив (профессия)' id='mwVg' rel='mw:WikiLink' title='Детектив (профессия)'>investigators</a>.</figcaption></figure>", + "data-cx": { + "mwVQ": {"adapted":true,"targetTitle":{"title":"Филон Византийский","pagelanguage":"ru"},"sourceTitle":{"title":"Philo of Byzantium","pagelanguage":"en","terms":{"description":["Ancient Greek engineer"]}}}, + "mwVg": {"adapted":true,"targetTitle":{"title":"Детектив (профессия)","pagelanguage":"ru","terms":{"description":["человек, расследующий преступления"]}},"sourceTitle":{"title":"Detective","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Allan_Pinkerton-retouch.jpg/69px-Allan_Pinkerton-retouch.jpg","width":69,"height":80},"terms":{"description":["investigator, either a member of a police agency or a private person"]}}} + } }, { "desc": "Image adaptation- source and target language directions differs", "from": "en", "to": "he", "source": "<figure class='mw-default-size mw-halign-left' typeof='mw:Image/Thumb' id='mwUQ'><a href='./File:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' resource='./File:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' data-file-width='125' data-file-height='248' data-file-type='bitmap' height='248' width='125' id='mwUw'/></a><figcaption id='mwVA'><a rel='mw:WikiLink' href='./Philo_of_Byzantium' title='Philo of Byzantium' id='mwVQ'>Philo's</a> experiment inspired later <a rel='mw:WikiLink' href='./Detective' title='Detective' id='mwVg'>investigators</a>.</figcaption></figure>", - "result": "<figure class='mw-default-size mw-halign-right' id='mwUQ' typeof='mw:Image/Thumb'><a href='./קובץ:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./קובץ:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a data-cx='{"adapted":false,"sourceTitle":"Philo of Byzantium"}' href='./Philo_of_Byzantium' id='mwVQ' rel='mw:WikiLink' title='Philo of Byzantium'>Philo's</a> experiment inspired later <a data-cx='{"adapted":false,"sourceTitle":"Detective"}' href='./Detective' id='mwVg' rel='mw:WikiLink' title='Detective'>investigators</a>.</figcaption></figure>" + "result": "<figure class='mw-default-size mw-halign-right' id='mwUQ' typeof='mw:Image/Thumb'><a href='./קובץ:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./קובץ:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/commons/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a data-cx='{"adapted":false,"sourceTitle":"Philo of Byzantium"}' href='./Philo_of_Byzantium' id='mwVQ' rel='mw:WikiLink' title='Philo of Byzantium'>Philo's</a> experiment inspired later <a data-cx='{"adapted":false,"sourceTitle":"Detective"}' href='./Detective' id='mwVg' rel='mw:WikiLink' title='Detective'>investigators</a>.</figcaption></figure>", + "data-cx": { + "mwVQ": {"adapted":false,"sourceTitle":{"title":"Philo of Byzantium","pagelanguage":"en","terms":{"description":["Ancient Greek engineer"]}}}, + "mwVg": {"adapted":false,"sourceTitle":{"title":"Detective","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Allan_Pinkerton-retouch.jpg/69px-Allan_Pinkerton-retouch.jpg","width":69,"height":80},"terms":{"description":["investigator, either a member of a police agency or a private person"]}}} + } }, { "desc": "Image adaptation- image is not in commons", "from": "en", "to": "ml", "source": "<figure class='mw-default-size mw-halign-left' typeof='mw:Image/Frame' id='mwUQ'><a href='./File:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' resource='./File:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/mediawiki/e/e6/Philos_experiment_of_the_burning_candle.PNG' data-file-width='125' data-file-height='248' data-file-type='bitmap' height='248' width='125' id='mwUw'/></a><figcaption id='mwVA'><a rel='mw:WikiLink' href='./Philo_of_Byzantium' title='Philo of Byzantium' id='mwVQ'>Philo's</a> experiment inspired later <a rel='mw:WikiLink' href='./Detective' title='Detective' id='mwVg'>investigators</a>.</figcaption></figure>", - "result": "<figure class='mw-default-size mw-halign-left' data-cx='{"adapted":false,"resource":"./File:Philos_experiment_of_the_burning_candle.PNG"}' id='mwUQ' typeof='mw:Image/Frame'><a href='./File:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./File:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/mediawiki/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a data-cx='{"adapted":false,"sourceTitle":"Philo of Byzantium"}' href='./Philo_of_Byzantium' id='mwVQ' rel='mw:WikiLink' title='Philo of Byzantium'>Philo's</a> experiment inspired later <a data-cx='{"adapted":false,"sourceTitle":"Detective"}' href='./Detective' id='mwVg' rel='mw:WikiLink' title='Detective'>investigators</a>.</figcaption></figure>" + "result": "<figure class='mw-default-size mw-halign-left' id='mwUQ' typeof='mw:Image/Frame'><a href='./File:Philos_experiment_of_the_burning_candle.PNG' id='mwUg'><img alt='Drawing of a burning candle enclosed in a glass bulb.' data-file-height='248' data-file-type='bitmap' data-file-width='125' height='248' id='mwUw' resource='./File:Philos_experiment_of_the_burning_candle.PNG' src='//upload.wikimedia.org/wikipedia/mediawiki/e/e6/Philos_experiment_of_the_burning_candle.PNG' width='125' /></a><figcaption id='mwVA'><a data-cx='{"adapted":false,"sourceTitle":"Philo of Byzantium"}' href='./Philo_of_Byzantium' id='mwVQ' rel='mw:WikiLink' title='Philo of Byzantium'>Philo's</a> experiment inspired later <a data-cx='{"adapted":false,"sourceTitle":"Detective"}' href='./Detective' id='mwVg' rel='mw:WikiLink' title='Detective'>investigators</a>.</figcaption></figure>", + "data-cx": { + "mwUQ": { + "adapted": false, + "resource": "./File:Philos_experiment_of_the_burning_candle.PNG" + }, + "mwVQ": {"adapted":false,"sourceTitle":{"title":"Philo of Byzantium","pagelanguage":"en","terms":{"description":["Ancient Greek engineer"]}}}, + "mwVg": {"adapted":false,"sourceTitle":{"title":"Detective","pagelanguage":"en","thumbnail":{"source":"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/Allan_Pinkerton-retouch.jpg/69px-Allan_Pinkerton-retouch.jpg","width":69,"height":80},"terms":{"description":["investigator, either a member of a police agency or a private person"]}}} + } }, { "desc": "Gallery adaptation", @@ -60,6 +195,6 @@ "from": "en", "to": "es", "source": "<p id='mwEA'><span typeof='mw:Extension/ref' data-mw='{"name":"ref","body":{"html":"Hello reference."}}' class='mw-ref'><a style='counter-reset: mw-Ref 1;'><span class='mw-reflink-text'>[1]</span></a></span></p>", - "result": "<p id='mwEA'><span typeof='mw:Extension/ref' data-mw='{"name":"ref","body":{"html":"Hola Remisión."}}' class='mw-ref'><a style='counter-reset: mw-Ref 1;'><span class='mw-reflink-text'>[1]</span></a></span></p>" + "result": "<p id='mwEA'><span typeof='mw:Extension/ref' data-cx='{"adapted":true}' data-mw='{"name":"ref","body":{"html":"Hola Remisión."}}' class='mw-ref'><a style='counter-reset: mw-Ref 1;'><span class='mw-reflink-text'>[1]</span></a></span></p>" } ] -- To view, visit https://gerrit.wikimedia.org/r/380897 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I12a723732b87c20d09967755ddb85182ee1ea9c3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/cxserver Gerrit-Branch: master Gerrit-Owner: Catrope <r...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits