]> git.ipfire.org Git - thirdparty/google/fonts.git/commitdiff
Enforce uniqueness of language names across all scripts
authornathan-williams <nathan.le.williams@gmail.com>
Thu, 18 Jul 2024 15:54:03 +0000 (11:54 -0400)
committernathan-williams <nathan.le.williams@gmail.com>
Thu, 18 Jul 2024 15:54:03 +0000 (11:54 -0400)
tests/test_data_languages.py

index 25a22dd3c4ea22f2511bb7c3d76c7b6a906530eb..e72bc088f0781acba9b2db2a6a195e60c9ddec4a 100644 (file)
@@ -270,13 +270,10 @@ def test_exemplar_parser():
 def test_language_uniqueness():
     names = Counter([])
     for lang in LANGUAGES.values():
-        # We check that names are unique *within a script* since
-        # when we display them in a menu we segment that menu by
-        # script and then by language
         if lang.preferred_name:
-            names[lang.script + "/" + lang.preferred_name] += 1
+            names[lang.preferred_name] += 1
         else:
-            names[lang.name + "/" + lang.preferred_name] += 1
+            names[lang.name] += 1
     if any(count > 1 for count in names.values()):
         duplicates = {name: count for name, count in names.items() if count > 1}
         pytest.fail(f"Duplicate language names: {duplicates}")