From: Simon Cozens Date: Fri, 1 Nov 2024 09:41:35 +0000 (+0000) Subject: Ensure language ID starts with language and script (#185) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1037e307d4c2222b7c6c4931dff0ec6ad62d9e0d;p=thirdparty%2Fgoogle%2Ffonts.git Ensure language ID starts with language and script (#185) * Ensure language ID starts with language_script * Fix more bad language IDs --- diff --git a/Lib/gflanguages/data/languages/har_Latn.textproto b/Lib/gflanguages/data/languages/har_Latn.textproto index 41cfa70137..d9bf6d40fa 100644 --- a/Lib/gflanguages/data/languages/har_Latn.textproto +++ b/Lib/gflanguages/data/languages/har_Latn.textproto @@ -1,5 +1,5 @@ id: "har_Latn" -language: "ha" +language: "har" script: "Latn" name: "Harari" population: 26000 diff --git a/Lib/gflanguages/data/languages/mak_Maka.textproto b/Lib/gflanguages/data/languages/mak_Maka.textproto index 9a2f175f6b..f1a6ebab35 100644 --- a/Lib/gflanguages/data/languages/mak_Maka.textproto +++ b/Lib/gflanguages/data/languages/mak_Maka.textproto @@ -1,6 +1,6 @@ id: "mak_Maka" language: "mak" -script: "Bugi" +script: "Maka" name: "Makasar, Old Makasar" population: 0 historical: true diff --git a/tests/test_data_languages.py b/tests/test_data_languages.py index 9b9ef8c84d..5dda6eb45b 100644 --- a/tests/test_data_languages.py +++ b/tests/test_data_languages.py @@ -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)