Skip to content

Commit

Permalink
Bug 1763783 - Part 4: Update language tags mappings to CLDR 41. r=pla…
Browse files Browse the repository at this point in the history
…tform-i18n-reviewers,jfkthame

Depends on D143276

Differential Revision: https://phabricator.services.mozilla.com/D143277
  • Loading branch information
anba committed Apr 9, 2022
1 parent 92c0b24 commit f75e49e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 43 deletions.
53 changes: 31 additions & 22 deletions intl/components/src/LocaleGenerated.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generated by make_intl_data.py. DO NOT EDIT.
// Version: CLDR-40
// URL: https://unicode.org/Public/cldr/40/core.zip
// Version: CLDR-41
// URL: https://unicode.org/Public/cldr/41/core.zip

#include "mozilla/Assertions.h"
#include "mozilla/Span.h"
Expand Down Expand Up @@ -99,8 +99,8 @@ static bool IsCanonicallyCasedTransformType(mozilla::Span<const char> type) {
#endif

// Mappings from language subtags to preferred values.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::LanguageMapping(LanguageSubtag& language) {
MOZ_ASSERT(IsStructurallyValidLanguageTag(language.Span()));
MOZ_ASSERT(IsCanonicallyCasedLanguageTag(language.Span()));
Expand Down Expand Up @@ -219,8 +219,8 @@ bool mozilla::intl::Locale::LanguageMapping(LanguageSubtag& language) {
}

// Language subtags with complex mappings.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::ComplexLanguageMapping(const LanguageSubtag& language) {
MOZ_ASSERT(IsStructurallyValidLanguageTag(language.Span()));
MOZ_ASSERT(IsCanonicallyCasedLanguageTag(language.Span()));
Expand All @@ -241,8 +241,8 @@ bool mozilla::intl::Locale::ComplexLanguageMapping(const LanguageSubtag& languag
}

// Mappings from script subtags to preferred values.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::ScriptMapping(ScriptSubtag& script) {
MOZ_ASSERT(IsStructurallyValidScriptTag(script.Span()));
MOZ_ASSERT(IsCanonicallyCasedScriptTag(script.Span()));
Expand All @@ -257,8 +257,8 @@ bool mozilla::intl::Locale::ScriptMapping(ScriptSubtag& script) {
}

// Mappings from region subtags to preferred values.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::RegionMapping(RegionSubtag& region) {
MOZ_ASSERT(IsStructurallyValidRegionTag(region.Span()));
MOZ_ASSERT(IsCanonicallyCasedRegionTag(region.Span()));
Expand Down Expand Up @@ -357,8 +357,8 @@ bool mozilla::intl::Locale::RegionMapping(RegionSubtag& region) {
}

// Region subtags with complex mappings.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::ComplexRegionMapping(const RegionSubtag& region) {
MOZ_ASSERT(IsStructurallyValidRegionTag(region.Span()));
MOZ_ASSERT(IsCanonicallyCasedRegionTag(region.Span()));
Expand All @@ -380,8 +380,8 @@ bool mozilla::intl::Locale::ComplexRegionMapping(const RegionSubtag& region) {
}

// Language subtags with complex mappings.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
void mozilla::intl::Locale::PerformComplexLanguageMappings() {
MOZ_ASSERT(IsStructurallyValidLanguageTag(Language().Span()));
MOZ_ASSERT(IsCanonicallyCasedLanguageTag(Language().Span()));
Expand Down Expand Up @@ -416,8 +416,8 @@ void mozilla::intl::Locale::PerformComplexLanguageMappings() {
}

// Region subtags with complex mappings.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
void mozilla::intl::Locale::PerformComplexRegionMappings() {
MOZ_ASSERT(IsStructurallyValidLanguageTag(Language().Span()));
MOZ_ASSERT(IsCanonicallyCasedLanguageTag(Language().Span()));
Expand Down Expand Up @@ -643,8 +643,8 @@ static bool IsLessThan(const T& a, const U& b) {
}

// Mappings from variant subtags to preferred values.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::PerformVariantMappings() {
// The variant subtags need to be sorted for binary search.
MOZ_ASSERT(std::is_sorted(mVariants.begin(), mVariants.end(),
Expand Down Expand Up @@ -707,8 +707,8 @@ bool mozilla::intl::Locale::PerformVariantMappings() {
}

// Canonicalize legacy locale identifiers.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::UpdateLegacyMappings() {
// We're mapping legacy tags to non-legacy form here.
// Other tags remain unchanged.
Expand Down Expand Up @@ -865,8 +865,8 @@ bool mozilla::intl::Locale::UpdateLegacyMappings() {
}

// Mappings from legacy sign languages.
// Derived from CLDR Supplemental Data, version 40.
// https://unicode.org/Public/cldr/40/core.zip
// Derived from CLDR Supplemental Data, version 41.
// https://unicode.org/Public/cldr/41/core.zip
bool mozilla::intl::Locale::SignLanguageMapping(LanguageSubtag& language,
const RegionSubtag& region) {
MOZ_ASSERT(language.EqualTo("sgn"));
Expand Down Expand Up @@ -1112,9 +1112,18 @@ const char* mozilla::intl::Locale::ReplaceTransformExtensionType(
}
}
else if (IsTransformKey(key, "m0")) {
if (IsTransformType(type, "beta-metsehaf")) {
return "betamets";
}
if (IsTransformType(type, "ies-jes")) {
return "iesjes";
}
if (IsTransformType(type, "names")) {
return "prprname";
}
if (IsTransformType(type, "tekie-alibekit")) {
return "tekieali";
}
}
return nullptr;
}
Loading

0 comments on commit f75e49e

Please sign in to comment.