[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search

CLDR Ticket #6901(closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Document recommended replacements with multiples

Reported by: mark Owned by: mark
Component: xxx-spec Data Locale:
Phase: Review: yoshito
Weeks: Data Xpath:

Description (last modified by mark) (diff)

(split from ticket:6785

In any event, the text in ​http://www.unicode.org/reports/tr35/#BCP_47_Language_Tag_Conversion must be fixed to have the right algorithm for replacement, so that it handles 'sh' properly. The key is that while the original base language will always be changed by languageAlias, any other existing subtags will not. So "sh-TR" => "sr-Latn-TR", but "sh-Cyrl" => "sr-Cyrl".

We sometimes have multiple replacements:

<territoryAlias type="SU" replacement="RU AM AZ BY EE GE KZ KG LV LT MD TJ TM UA UZ" reason="deprecated"/> <!-- Union of Soviet Socialist Republics -->

Right now, the first listed one is the most likely, in the absence of other information. However, we could specify a slightly more sophisticated replacement algorithm for territory replacement.

  1. If there is a single territory in the replacement, use it.
  2. Otherwise, look up the most likely territory for the base language code (and script, if there is one).
  3. If that likely territory is in the list, use it.
  4. Otherwise, use the first territory in the list.

Thus, for example "hy-SU" (Armenian as used in the Soviet Union) becomes "hy-AM" (Armenian as used in Armenia).

This is not a high priority fix, but that could change it


Change History

comment:1 Changed 4 years ago by mark

  • Description modified (diff)

comment:2 Changed 4 years ago by srl

Also please fix the LanguageTagField class so that the default case is more descriptive. Bug was obscured due to IcuBug:10620

        private String get(LanguageTagParser parser) {
            switch (this) {
            case language:
                return parser.getLanguage();
            case script:
                return parser.getScript();
            case region:
                return parser.getRegion();
            //case variant:
            //    return parser.getVariants().toString(); // Correct?
                throw new IllegalArgumentException("Unsupported LanguageTagParser field: " + this.toString() + " on string: " + parser.toString());

comment:3 Changed 4 years ago by mark

  • Milestone changed from 25rc to 25final

comment:4 Changed 4 years ago by mark

  • Component changed from docs to spec

comment:5 Changed 4 years ago by mark

  • Status changed from new to reviewing
  • Review set to yoshito

comment:6 Changed 4 years ago by yoshito

  • Status changed from reviewing to closed
  • Resolution set to fixed

Add a comment

Modify Ticket

as closed
Next status will be 'new'
Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.