summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2023-12-20 13:51:40 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2024-01-07 23:01:45 +0000
commitd6e607fa38908f8beeff0e892a0d25af74f8a4f2 (patch)
tree28a1cc3e741dd02a0a4b00524866cb112dd67dd3
parent4481eb0f0022ba7c7208e855554548a1a7850fb4 (diff)
rules: fix iso639 codes after removals
https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3_Retirements.tab ais Nataoran Amis S Split by part going to Amis [ami] and creating Sakizaya [szy] with the remaining part 2019-01-25 uun Kulon-Pazeh S Split into Kulon [uon] and Pazeh [pzh] 2022-01-20 See also the pycountry commit https://github.com/pycountry/pycountry/commit/a2341a11df5b5fddb26519e9b9cbe1befdee74a9 Fixes #430
-rw-r--r--rules/base.xml5
-rw-r--r--tests/test_rules_xml.py13
2 files changed, 13 insertions, 5 deletions
diff --git a/rules/base.xml b/rules/base.xml
index 4e18bd12..ad4df7c8 100644
--- a/rules/base.xml
+++ b/rules/base.xml
@@ -6508,15 +6508,16 @@
<iso639Id>ckv</iso639Id>
<iso639Id>pwn</iso639Id>
<iso639Id>pyu</iso639Id>
+ <iso639Id>pzh</iso639Id>
<iso639Id>dru</iso639Id>
- <iso639Id>ais</iso639Id>
<iso639Id>ssf</iso639Id>
+ <iso639Id>szy</iso639Id>
<iso639Id>tao</iso639Id>
<iso639Id>tsu</iso639Id>
<iso639Id>trv</iso639Id>
<iso639Id>xnb</iso639Id>
<iso639Id>sxr</iso639Id>
- <iso639Id>uun</iso639Id>
+ <iso639Id>uon</iso639Id>
<iso639Id>fos</iso639Id>
</languageList>
</configItem>
diff --git a/tests/test_rules_xml.py b/tests/test_rules_xml.py
index cd0df4f8..6541d17a 100644
--- a/tests/test_rules_xml.py
+++ b/tests/test_rules_xml.py
@@ -266,9 +266,16 @@ def test_iso639(layout):
expected_without_language = ["brai", "custom", "trans"]
for code in layout.iso639:
- assert (
- code in language_codes
- ), f'{layout.rulesfile}: unknown language code "{code}" in {layout.name}'
+ try:
+ assert (
+ code in language_codes
+ ), f'{layout.rulesfile}: unknown language code "{code}" in {layout.name}'
+ except AssertionError as e:
+ # needs pycountry 23.12.7, this code can be removed when our CI has pycountry new enough
+ if code in ["pzh", "szy", "uon"]:
+ pytest.skip("pycountry too old, skipping")
+ else:
+ raise e
assert (
layout.iso639 or layout.layout.name in expected_without_language