Annotation of embedaddon/php/ext/intl/tests/locale_get_display_variant.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: locale_get_display_variant()
! 3: --SKIPIF--
! 4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: /*
! 9: * Try getting the display_variant for different locales
! 10: * with Procedural and Object methods.
! 11: */
! 12:
! 13: function ut_main()
! 14: {
! 15: $res_str = '';
! 16:
! 17: $disp_locales=array('en','fr','de');
! 18:
! 19: $locales = array(
! 20: 'uk-ua_CALIFORNIA@currency=;currency=GRN',
! 21: 'root',
! 22: 'uk@currency=EURO',
! 23: 'Hindi',
! 24: //Simple language subtag
! 25: 'de',
! 26: 'fr',
! 27: 'ja',
! 28: 'i-enochian', //(example of a grandfathered tag)
! 29: //Language subtag plus Script subtag:
! 30: 'zh-Hant',
! 31: 'zh-Hans',
! 32: 'sr-Cyrl',
! 33: 'sr-Latn',
! 34: //Language-Script-Region
! 35: 'zh-Hans-CN',
! 36: 'sr-Latn-CS',
! 37: //Language-Variant
! 38: 'sl-rozaj',
! 39: 'sl-nedis',
! 40: //Language-Region-Variant
! 41: 'de-CH-1901',
! 42: 'sl-IT-nedis',
! 43: //Language-Script-Region-Variant
! 44: 'sl-Latn-IT-nedis',
! 45: //Language-Region:
! 46: 'de-DE',
! 47: 'en-US',
! 48: 'es-419',
! 49: //Private use subtags:
! 50: 'de-CH-x-phonebk',
! 51: 'az-Arab-x-AZE-derbend',
! 52: //Extended language subtags
! 53: 'zh-min',
! 54: 'zh-min-nan-Hant-CN',
! 55: //Private use registry values
! 56: 'x-whatever',
! 57: 'qaa-Qaaa-QM-x-southern',
! 58: 'sr-Latn-QM',
! 59: 'sr-Qaaa-CS',
! 60: /*Tags that use extensions (examples ONLY: extensions MUST be defined
! 61: by revision or update to this document or by RFC): */
! 62: 'en-US-u-islamCal',
! 63: 'zh-CN-a-myExt-x-private',
! 64: 'en-a-myExt-b-another',
! 65: //Some Invalid Tags:
! 66: 'de-419-DE',
! 67: 'a-DE',
! 68: 'ar-a-aaa-b-bbb-a-ccc'
! 69: );
! 70:
! 71:
! 72: $res_str = '';
! 73:
! 74: foreach( $locales as $locale )
! 75: {
! 76: $res_str .= "locale='$locale'\n";
! 77: foreach( $disp_locales as $disp_locale )
! 78: {
! 79: $scr = ut_loc_get_display_variant( $locale ,$disp_locale );
! 80: $res_str .= "disp_locale=$disp_locale : display_variant=$scr";
! 81: $res_str .= "\n";
! 82: }
! 83: $res_str .= "-----------------\n";
! 84: }
! 85:
! 86: return $res_str;
! 87:
! 88: }
! 89:
! 90: include_once( 'ut_common.inc' );
! 91: ut_run();
! 92:
! 93: ?>
! 94: --EXPECTREGEX--
! 95: locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
! 96: disp_locale=en : display_variant=CALIFORNIA
! 97: disp_locale=fr : display_variant=CALIFORNIA
! 98: disp_locale=de : display_variant=CALIFORNIA
! 99: -----------------
! 100: locale='root'
! 101: disp_locale=en : display_variant=
! 102: disp_locale=fr : display_variant=
! 103: disp_locale=de : display_variant=
! 104: -----------------
! 105: locale='uk@currency=EURO'
! 106: disp_locale=en : display_variant=
! 107: disp_locale=fr : display_variant=
! 108: disp_locale=de : display_variant=
! 109: -----------------
! 110: locale='Hindi'
! 111: disp_locale=en : display_variant=
! 112: disp_locale=fr : display_variant=
! 113: disp_locale=de : display_variant=
! 114: -----------------
! 115: locale='de'
! 116: disp_locale=en : display_variant=
! 117: disp_locale=fr : display_variant=
! 118: disp_locale=de : display_variant=
! 119: -----------------
! 120: locale='fr'
! 121: disp_locale=en : display_variant=
! 122: disp_locale=fr : display_variant=
! 123: disp_locale=de : display_variant=
! 124: -----------------
! 125: locale='ja'
! 126: disp_locale=en : display_variant=
! 127: disp_locale=fr : display_variant=
! 128: disp_locale=de : display_variant=
! 129: -----------------
! 130: locale='i-enochian'
! 131: disp_locale=en : display_variant=
! 132: disp_locale=fr : display_variant=
! 133: disp_locale=de : display_variant=
! 134: -----------------
! 135: locale='zh-Hant'
! 136: disp_locale=en : display_variant=
! 137: disp_locale=fr : display_variant=
! 138: disp_locale=de : display_variant=
! 139: -----------------
! 140: locale='zh-Hans'
! 141: disp_locale=en : display_variant=
! 142: disp_locale=fr : display_variant=
! 143: disp_locale=de : display_variant=
! 144: -----------------
! 145: locale='sr-Cyrl'
! 146: disp_locale=en : display_variant=
! 147: disp_locale=fr : display_variant=
! 148: disp_locale=de : display_variant=
! 149: -----------------
! 150: locale='sr-Latn'
! 151: disp_locale=en : display_variant=
! 152: disp_locale=fr : display_variant=
! 153: disp_locale=de : display_variant=
! 154: -----------------
! 155: locale='zh-Hans-CN'
! 156: disp_locale=en : display_variant=
! 157: disp_locale=fr : display_variant=
! 158: disp_locale=de : display_variant=
! 159: -----------------
! 160: locale='sr-Latn-CS'
! 161: disp_locale=en : display_variant=
! 162: disp_locale=fr : display_variant=
! 163: disp_locale=de : display_variant=
! 164: -----------------
! 165: locale='sl-rozaj'
! 166: disp_locale=en : display_variant=
! 167: disp_locale=fr : display_variant=
! 168: disp_locale=de : display_variant=
! 169: -----------------
! 170: locale='sl-nedis'
! 171: disp_locale=en : display_variant=
! 172: disp_locale=fr : display_variant=
! 173: disp_locale=de : display_variant=
! 174: -----------------
! 175: locale='de-CH-1901'
! 176: disp_locale=en : display_variant=Traditional German orthography
! 177: disp_locale=fr : display_variant=orthographe allemande traditionnelle
! 178: disp_locale=de : display_variant=(1901|[Aa]lte deutsche Rechtschreibung)
! 179: -----------------
! 180: locale='sl-IT-nedis'
! 181: disp_locale=en : display_variant=Natisone dialect
! 182: disp_locale=fr : display_variant=dialecte de Natisone
! 183: disp_locale=de : display_variant=(NEDIS|Natisone-Dialekt)
! 184: -----------------
! 185: locale='sl-Latn-IT-nedis'
! 186: disp_locale=en : display_variant=Natisone dialect
! 187: disp_locale=fr : display_variant=dialecte de Natisone
! 188: disp_locale=de : display_variant=(NEDIS|Natisone-Dialekt)
! 189: -----------------
! 190: locale='de-DE'
! 191: disp_locale=en : display_variant=
! 192: disp_locale=fr : display_variant=
! 193: disp_locale=de : display_variant=
! 194: -----------------
! 195: locale='en-US'
! 196: disp_locale=en : display_variant=
! 197: disp_locale=fr : display_variant=
! 198: disp_locale=de : display_variant=
! 199: -----------------
! 200: locale='es-419'
! 201: disp_locale=en : display_variant=
! 202: disp_locale=fr : display_variant=
! 203: disp_locale=de : display_variant=
! 204: -----------------
! 205: locale='de-CH-x-phonebk'
! 206: disp_locale=en : display_variant=X_PHONEBK
! 207: disp_locale=fr : display_variant=X_PHONEBK
! 208: disp_locale=de : display_variant=X_PHONEBK
! 209: -----------------
! 210: locale='az-Arab-x-AZE-derbend'
! 211: disp_locale=en : display_variant=(AZE_DERBEND)?
! 212: disp_locale=fr : display_variant=(AZE_DERBEND)?
! 213: disp_locale=de : display_variant=(AZE_DERBEND)?
! 214: -----------------
! 215: locale='zh-min'
! 216: disp_locale=en : display_variant=
! 217: disp_locale=fr : display_variant=
! 218: disp_locale=de : display_variant=
! 219: -----------------
! 220: locale='zh-min-nan-Hant-CN'
! 221: disp_locale=en : display_variant=NAN_HANT_CN
! 222: disp_locale=fr : display_variant=NAN_HANT_CN
! 223: disp_locale=de : display_variant=NAN_HANT_CN
! 224: -----------------
! 225: locale='x-whatever'
! 226: disp_locale=en : display_variant=
! 227: disp_locale=fr : display_variant=
! 228: disp_locale=de : display_variant=
! 229: -----------------
! 230: locale='qaa-Qaaa-QM-x-southern'
! 231: disp_locale=en : display_variant=X_SOUTHERN
! 232: disp_locale=fr : display_variant=X_SOUTHERN
! 233: disp_locale=de : display_variant=X_SOUTHERN
! 234: -----------------
! 235: locale='sr-Latn-QM'
! 236: disp_locale=en : display_variant=
! 237: disp_locale=fr : display_variant=
! 238: disp_locale=de : display_variant=
! 239: -----------------
! 240: locale='sr-Qaaa-CS'
! 241: disp_locale=en : display_variant=
! 242: disp_locale=fr : display_variant=
! 243: disp_locale=de : display_variant=
! 244: -----------------
! 245: locale='en-US-u-islamCal'
! 246: disp_locale=en : display_variant=U_ISLAMCAL
! 247: disp_locale=fr : display_variant=U_ISLAMCAL
! 248: disp_locale=de : display_variant=U_ISLAMCAL
! 249: -----------------
! 250: locale='zh-CN-a-myExt-x-private'
! 251: disp_locale=en : display_variant=A_MYEXT_X_PRIVATE
! 252: disp_locale=fr : display_variant=A_MYEXT_X_PRIVATE
! 253: disp_locale=de : display_variant=A_MYEXT_X_PRIVATE
! 254: -----------------
! 255: locale='en-a-myExt-b-another'
! 256: disp_locale=en : display_variant=(MYEXT_B_ANOTHER)?
! 257: disp_locale=fr : display_variant=(MYEXT_B_ANOTHER)?
! 258: disp_locale=de : display_variant=(MYEXT_B_ANOTHER)?
! 259: -----------------
! 260: locale='de-419-DE'
! 261: disp_locale=en : display_variant=DE
! 262: disp_locale=fr : display_variant=DE
! 263: disp_locale=de : display_variant=DE
! 264: -----------------
! 265: locale='a-DE'
! 266: disp_locale=en : display_variant=
! 267: disp_locale=fr : display_variant=
! 268: disp_locale=de : display_variant=
! 269: -----------------
! 270: locale='ar-a-aaa-b-bbb-a-ccc'
! 271: disp_locale=en : display_variant=(AAA_B_BBB_A_CCC)?
! 272: disp_locale=fr : display_variant=(AAA_B_BBB_A_CCC)?
! 273: disp_locale=de : display_variant=(AAA_B_BBB_A_CCC)?
! 274: -----------------
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>