src/share/classes/sun/util/locale/LanguageTag.java

Print this page
rev 6663 : imported patch 8008576


 117             {"no-bok",      "nb"},
 118             {"no-nyn",      "nn"},
 119             {"sgn-BE-FR",   "sfb"},
 120             {"sgn-BE-NL",   "vgt"},
 121             {"sgn-CH-DE",   "sgg"},
 122             {"zh-guoyu",    "cmn"},
 123             {"zh-hakka",    "hak"},
 124             {"zh-min",      "nan-x-zh-min"},        // fallback
 125             {"zh-min-nan",  "nan"},
 126             {"zh-xiang",    "hsn"},
 127         };
 128         for (String[] e : entries) {
 129             GRANDFATHERED.put(LocaleUtils.toLowerString(e[0]), e);
 130         }
 131     }
 132 
 133     private LanguageTag() {
 134     }
 135 
 136     /*
 137      * BNF in RFC5464
 138      *
 139      * Language-Tag  = langtag             ; normal language tags
 140      *               / privateuse          ; private use tag
 141      *               / grandfathered       ; grandfathered tags
 142      *
 143      *
 144      * langtag       = language
 145      *                 ["-" script]
 146      *                 ["-" region]
 147      *                 *("-" variant)
 148      *                 *("-" extension)
 149      *                 ["-" privateuse]
 150      *
 151      * language      = 2*3ALPHA            ; shortest ISO 639 code
 152      *                 ["-" extlang]       ; sometimes followed by
 153      *                                     ; extended language subtags
 154      *               / 4ALPHA              ; or reserved for future use
 155      *               / 5*8ALPHA            ; or registered language subtag
 156      *
 157      * extlang       = 3ALPHA              ; selected ISO 639 codes




 117             {"no-bok",      "nb"},
 118             {"no-nyn",      "nn"},
 119             {"sgn-BE-FR",   "sfb"},
 120             {"sgn-BE-NL",   "vgt"},
 121             {"sgn-CH-DE",   "sgg"},
 122             {"zh-guoyu",    "cmn"},
 123             {"zh-hakka",    "hak"},
 124             {"zh-min",      "nan-x-zh-min"},        // fallback
 125             {"zh-min-nan",  "nan"},
 126             {"zh-xiang",    "hsn"},
 127         };
 128         for (String[] e : entries) {
 129             GRANDFATHERED.put(LocaleUtils.toLowerString(e[0]), e);
 130         }
 131     }
 132 
 133     private LanguageTag() {
 134     }
 135 
 136     /*
 137      * BNF in RFC5646
 138      *
 139      * Language-Tag  = langtag             ; normal language tags
 140      *               / privateuse          ; private use tag
 141      *               / grandfathered       ; grandfathered tags
 142      *
 143      *
 144      * langtag       = language
 145      *                 ["-" script]
 146      *                 ["-" region]
 147      *                 *("-" variant)
 148      *                 *("-" extension)
 149      *                 ["-" privateuse]
 150      *
 151      * language      = 2*3ALPHA            ; shortest ISO 639 code
 152      *                 ["-" extlang]       ; sometimes followed by
 153      *                                     ; extended language subtags
 154      *               / 4ALPHA              ; or reserved for future use
 155      *               / 5*8ALPHA            ; or registered language subtag
 156      *
 157      * extlang       = 3ALPHA              ; selected ISO 639 codes