Dart Team | 4b27a88 | 2019-03-25 08:08:29 -0700 | [diff] [blame] | 1 | // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | /// Test data for Locale handling. |
| 6 | /// |
| 7 | /// DO NOT EDIT. This file is autogenerated by script. |
| 8 | /// TODO(hugovdm): improve the script and file related ICU bugs. |
| 9 | |
| 10 | /// Test data: a map from unnormalized locale names to normalized locale names. |
| 11 | Map<String, String> localeParsingTestData = <String, String>{ |
| 12 | // Simple with normalization |
| 13 | 'Zh': 'zh', |
| 14 | 'zH-cn': 'zh-CN', |
| 15 | 'ZH-Cn': 'zh-CN', |
| 16 | 'zh-cN': 'zh-CN', |
| 17 | 'zh-hans': 'zh-Hans', |
| 18 | 'ZH-HANS-CN': 'zh-Hans-CN', |
| 19 | |
| 20 | // Region codes can be three digits |
| 21 | 'es-419': 'es-419', |
| 22 | |
| 23 | // While language is usually 2 characters, it can also be 3 |
| 24 | 'CKB-arab': 'ckb-Arab', |
| 25 | |
| 26 | // With simple canonicalization |
| 27 | 'Iw': 'he', |
| 28 | 'iW': 'he', |
| 29 | 'My-Bu': 'my-MM', |
| 30 | |
| 31 | // "und" is the language tag for undefined language |
| 32 | 'und': 'und', |
| 33 | |
| 34 | // Normalization: sorting of extension subtags |
| 35 | 'en-z-abc-001-foo-fii-bar-u-cu-usd-co-phonebk': |
| 36 | 'en-u-co-phonebk-cu-usd-z-abc-001-foo-fii-bar', |
| 37 | |
| 38 | // Normalises tags, sorts subtags alphabetically |
| 39 | 'UND-lkjh-qw-12345-Abcde-U-Zz-Aaa-Co-Zxc-T-AF-Latn-Za-M0-Bar': |
| 40 | 'und-Lkjh-QW-12345-abcde-t-af-latn-za-m0-bar-u-co-zxc-zz-aaa', |
| 41 | |
| 42 | // Supports multiple "tvalues" for each "tpart" |
| 43 | 'en-u-cu-usd-t-a0-ghi-jkl-b0-abc-def-a-aaa': |
| 44 | 'en-a-aaa-t-a0-ghi-jkl-b0-abc-def-u-cu-usd', |
| 45 | |
| 46 | // Private-use extension subtags do not get sorted |
| 47 | 'en-x-BCDE0123-ABCD0123': 'en-x-bcde0123-abcd0123', |
| 48 | 'en-x-BCDE0123-123456-ABCD0123': 'en-x-bcde0123-123456-abcd0123', |
Dart Team | 53bc5f4 | 2019-04-01 15:21:25 -0700 | [diff] [blame] | 49 | |
| 50 | // Digits in u-extension values |
| 51 | 'en-u-hc-h11': 'en-u-hc-h11', |
| 52 | 'en-u-hc-h23': 'en-u-hc-h23', |
| 53 | |
| 54 | // Digits in t-extension values |
| 55 | 'en-t-m0-c11': 'en-t-m0-c11', |
Dart Team | 4b27a88 | 2019-03-25 08:08:29 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | /// Invalid Language Tags. |
| 59 | List<String> invalidLocales = <String>[ |
| 60 | 'en-', |
| 61 | '-za', |
| 62 | 'en--za', |
| 63 | '419', |
| 64 | 'en-t', |
| 65 | 'en-t-', |
| 66 | 'en-t-de-t-fr', |
| 67 | 'en-u', |
| 68 | 'en-u-', |
| 69 | 'en-u-ca-islamic-', |
| 70 | 'en-u-cu-eur-u-co-phonebk', |
| 71 | 'en-x-', |
| 72 | 'en-x-foo-', |
| 73 | 'en-x-abcdefghi', |
| 74 | 'en-z-', |
| 75 | 'en-z-aaa-z-bbb', |
| 76 | ]; |