]> granicus.if.org Git - icu/commit
ICU-21125 Improvements to resource fallback:
authorRich Gillam <62772518+richgillam@users.noreply.github.com>
Thu, 4 Aug 2022 23:01:04 +0000 (16:01 -0700)
committerRich Gillam <62772518+richgillam@users.noreply.github.com>
Fri, 16 Sep 2022 21:26:50 +0000 (14:26 -0700)
commit498abf69611ca32ed41c5811f82ab7dfcb244757
tree4e378c360728a7aa22646c603405ea06d07168d3
parent9dc1c020a19a5b950af3e6304b97e7396b92aaaf
ICU-21125 Improvements to resource fallback:

- Added code to use the parentLocales data in supplementalData.xml to determine the "parent locale ID" to use when
  the requested resource bundle is not present (ICU-21126).
- Added code to change the parent-chain search path to handle the script better (ICU-21125; algorithm was described
  in CLDR-15265):
  - The base search patch is now ll_Ssss_RR -> ll_RR -> ll_Ssss -> ll -> root
  - If the requested script is not the default script for the requested language and region, we automatically
    avoid fallbacks that will implicitly change the script.
- Added new code to the CLDR-to-ICU data generation tool to generate source code, and used it to generate the lookup
  tables for the new resource-fallback logic (we can't use the existing resource files for this, since that would
  involve opening a resource bundle while trying to open another resource bundle).  The data-generation stuff is
  intended to be generic enough to allow for us to generate more static data tables in the future.
- Commented out a few collator tests, and changed one resource bundle test, because they're incompatible with the
  new fallback logic (specifically, the default-script logic).
12 files changed:
icu4c/source/common/localefallback_data.h [new file with mode: 0644]
icu4c/source/common/uresbund.cpp
icu4c/source/test/cintltst/crestst.c
icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java
icu4j/main/classes/core/src/com/ibm/icu/impl/LocaleFallbackData.java [new file with mode: 0644]
icu4j/main/tests/collate/src/com/ibm/icu/dev/test/util/ULocaleCollationTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java
tools/cldr/cldr-to-icu/README.txt
tools/cldr/cldr-to-icu/build-icu-data.xml
tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/CodeGenerator.java [new file with mode: 0644]
tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/ant/GenerateCodeTask.java [new file with mode: 0644]
tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/generator/ResourceFallbackCodeGenerator.java [new file with mode: 0644]