]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
Ensure language ID starts with language and script (#185)
authorSimon Cozens <simon@simon-cozens.org>
Fri, 1 Nov 2024 09:41:35 +0000 (09:41 +0000)
committerGitHub <noreply@github.com>
Fri, 1 Nov 2024 09:41:35 +0000 (09:41 +0000)
* Ensure language ID starts with language_script

* Fix more bad language IDs

Lib/gflanguages/data/languages/har_Latn.textproto
Lib/gflanguages/data/languages/mak_Maka.textproto
tests/test_data_languages.py

index 41cfa70137f81390b146e784d9c4bd27272b3e5e..d9bf6d40fa1bd04e40da188e194081bc0c9990ea 100644 (file)
@@ -1,5 +1,5 @@
 id: "har_Latn"
-language: "ha"
+language: "har"
 script: "Latn"
 name: "Harari"
 population: 26000
index 9a2f175f6b1f34d6a81634b5dba97786e721e564..f1a6ebab35eece4d192f85b2b88c5a3aa7fa6d2c 100644 (file)
@@ -1,6 +1,6 @@
 id: "mak_Maka"
 language: "mak"
-script: "Bugi"
+script: "Maka"
 name: "Makasar, Old Makasar"
 population: 0
 historical: true
index 9b9ef8c84d24f9c105b028a369c393cff637bff7..5dda6eb45b4bd3c8feb29f658c5c49fdbd95832f 100644 (file)
@@ -336,3 +336,12 @@ def test_language_name_structure():
         pytest.fail(
             f'Languages names without expected structure ("LANGUAGE, MODIFIER (SCRIPT)"): {misstructured_language_names}'
         )
+
+
+@pytest.mark.parametrize("lang_code", LANGUAGES)
+def test_id_well_formed(lang_code):
+    if lang_code in ["tw_akuapem_Latn"]:
+        pytest.xfail("Well we need to have a conversation about that")
+        return
+    lang = LANGUAGES[lang_code]
+    assert lang.id.startswith(lang.language + "_" + lang.script)