diff --git a/docs/userguide/icu_data/buildtool.md b/docs/userguide/icu_data/buildtool.md index da4c859fa7..4262e414b0 100644 --- a/docs/userguide/icu_data/buildtool.md +++ b/docs/userguide/icu_data/buildtool.md @@ -222,12 +222,17 @@ There are two concrete differences between additive and subtractive mode: | | Additive | Subtractive | |-------------------------|-------------|-------------| | Default Feature Filter | `"exclude"` | `"include"` | -| Default Resource Filter | `"-/"` | `"+/"` | +| Default Resource Filter | `"-/"`, `"+/%%ALIAS"`, `"+/%%Parent"` | `"+/"` | To enable additive mode, add the following setting to your filter file: strategy: "additive" +**Caution:** If using `"-/"` or similar top-level exclusion rules, be aware of +the fields `"+/%%Parent"` and `"+/%%ALIAS"`, which are required in locale tree +resource bundles. Excluding these paths may cause unexpected locale fallback +behavior. + #### Filter Types You may list *filters* for each category in the *featureFilters* section of diff --git a/icu4c/source/python/icutools/databuilder/filtration.py b/icu4c/source/python/icutools/databuilder/filtration.py index 9150eb28f2..0eff5b9c57 100644 --- a/icu4c/source/python/icutools/databuilder/filtration.py +++ b/icu4c/source/python/icutools/databuilder/filtration.py @@ -319,9 +319,15 @@ class ResourceFilterInfo(object): ) ] if self.strategy == "additive": - self.rules_by_file = [["-/"] for _ in range(len(files))] + self.rules_by_file = [ + [r"-/", r"+/%%ALIAS", r"+/%%Parent"] + for _ in range(len(files)) + ] else: - self.rules_by_file = [["+/"] for _ in range(len(files))] + self.rules_by_file = [ + [r"+/"] + for _ in range(len(files)) + ] def add_rules(self, file_filter, rules): for file, rule_list in zip(self.input_files, self.rules_by_file):