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