| 1 |
|
| 2 |
if itstool.found() |
| 3 |
|
| 4 |
mi_translated = i18n.itstool_join( |
| 5 |
input: 'com.mesonbuild.test.intlprog.metainfo.xml', |
| 6 |
output: 'com.mesonbuild.test.intlprog.metainfo.xml', |
| 7 |
mo_targets: mo_targets, |
| 8 |
its_files: ['metainfo.its'], |
| 9 |
install: true, |
| 10 |
install_dir: get_option('datadir') / 'metainfo', |
| 11 |
) |
| 12 |
|
| 13 |
# older versions of itstool have a bug where ITS rules specified on the command-line |
| 14 |
# are not read when joining files. Since we don't install appstream in the Meson CI |
| 15 |
# environment, the to-be-tested entry will be untranslated and the test would fail, so |
| 16 |
# we just skip verification if the installed itstool is too old. |
| 17 |
r = run_command(itstool, '-v', check: true) |
| 18 |
itstool_v = r.stdout().strip().split() |
| 19 |
if itstool_v[1].version_compare('>=2.0.6') |
| 20 |
verify_exe = find_program('verify.py') |
| 21 |
test('test xml translation', |
| 22 |
verify_exe, |
| 23 |
args: [mi_translated, |
| 24 |
'<p xml:lang="de">Dies ist <code>Text</code> mit <em>eingebetteten XML Tags</em>. Toll!</p>'] |
| 25 |
) |
| 26 |
else |
| 27 |
message('Skipping translation verification: Itstool too old.') |
| 28 |
endif |
| 29 |
|
| 30 |
else |
| 31 |
install_data('com.mesonbuild.test.intlprog.metainfo.xml', |
| 32 |
install_dir: get_option('datadir') / 'metainfo') |
| 33 |
endif |