From 734ef2c7ca96d469062b4e24c8fde133fe369d06 Mon Sep 17 00:00:00 2001 From: Craig Cornelius Date: Tue, 12 Nov 2024 13:17:05 -0800 Subject: [PATCH] Remove root locale from tests for locale names and plural rules (#341) --- testgen/generators/localeDisplayNames.py | 5 +++++ testgen/generators/plurals.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/testgen/generators/localeDisplayNames.py b/testgen/generators/localeDisplayNames.py index 1e1a7613..066f227e 100644 --- a/testgen/generators/localeDisplayNames.py +++ b/testgen/generators/localeDisplayNames.py @@ -99,6 +99,11 @@ def generateLanguageNameTestDataObjects(self, rawtestdata): ) continue else: + # Ignore the root locale + if locale_label == 'root': + logging.info('root locale ignored for %s, %s, %s', + test_data[0], locale_label, language_display) + continue label = str(count).rjust(max_digits, "0") test_json = { "label": label, diff --git a/testgen/generators/plurals.py b/testgen/generators/plurals.py index 6ad7bbd3..89fdbcee 100644 --- a/testgen/generators/plurals.py +++ b/testgen/generators/plurals.py @@ -135,6 +135,11 @@ def process_xml_file(self, filename, num_type): # Parse this text to get samples for locale in tags: for sample in samples: + # Ignore "root" locale. + if locale == 'root': + logging.info('Plural rules: root locale ignored for %s, %s, %s', + locale, num_type, sample) + continue test = { 'locale': locale, 'label': str(self.label_num),