Annotation of embedaddon/php/ext/intl/tests/locale_get_display_name2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: locale_get_display_name() 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_name 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: 'sl_IT_nedis_KIRTI',
22: 'sl_IT_nedis-a-kirti-x-xyz',
23: 'sl_IT_rozaj',
24: 'sl_IT_NEDIS_ROJAZ_1901',
25: 'i-enochian',
26: 'zh-hakka',
27: 'zh-wuu',
28: 'i-tay',
29: 'sgn-BE-nl',
30: 'sgn-CH-de',
31: 'sl_IT_rozaj@currency=EUR',
32: 'uk-ua_CALIFORNIA@currency=;currency=GRN',
33: 'root',
34: 'uk@currency=EURO',
35: 'Hindi',
36: //Simple language subtag
37: 'de',
38: 'fr',
39: 'ja',
40: 'i-enochian', //(example of a grandfathered tag)
41: //Language subtag plus Script subtag:
42: 'zh-Hant',
43: 'zh-Hans',
44: 'sr-Cyrl',
45: 'sr-Latn',
46: //Language-Script-Region
47: 'zh-Hans-CN',
48: 'sr-Latn-CS',
49: //Language-Variant
50: 'sl-rozaj',
51: 'sl-nedis',
52: //Language-Region-Variant
53: 'de-CH-1901',
54: 'sl-IT-nedis',
55: //Language-Script-Region-Variant
56: 'sl-Latn-IT-nedis',
57: //Language-Region:
58: 'de-DE',
59: 'en-US',
60: 'es-419',
61: //Private use subtags:
62: 'de-CH-x-phonebk',
63: 'az-Arab-x-AZE-derbend',
64: //Extended language subtags
65: 'zh-min',
66: 'zh-min-nan-Hant-CN',
67: //Private use registry values
68: 'x-whatever',
69: 'qaa-Qaaa-QM-x-southern',
70: 'sr-Latn-QM',
71: 'sr-Qaaa-CS',
72: /*Tags that use extensions (examples ONLY: extensions MUST be defined
73: by revision or update to this document or by RFC): */
74: 'en-US-u-islamCal',
75: 'zh-CN-a-myExt-x-private',
76: 'en-a-myExt-b-another',
77: //Some Invalid Tags:
78: 'de-419-DE',
79: 'a-DE',
80: 'ar-a-aaa-b-bbb-a-ccc'
81: );
82:
83:
84: $res_str = '';
85:
86: foreach( $locales as $locale )
87: {
88: $res_str .= "locale='$locale'\n";
89: foreach( $disp_locales as $disp_locale )
90: {
91: $scr = ut_loc_get_display_name( $locale ,$disp_locale );
92: $scr = str_replace(array('(', ')'), '#', $scr);
93: $res_str .= "disp_locale=$disp_locale : display_name=$scr";
94: $res_str .= "\n";
95: }
96: $res_str .= "-----------------\n";
97: }
98:
99: return $res_str;
100:
101: }
102:
103: include_once( 'ut_common.inc' );
104: ut_run();
105:
106: ?>
107: --EXPECTREGEX--
108: locale='sl_IT_nedis_KIRTI'
109: disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
110: disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
111: disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
112: -----------------
113: locale='sl_IT_nedis-a-kirti-x-xyz'
114: disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
115: disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
116: disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
117: -----------------
118: locale='sl_IT_rozaj'
119: disp_locale=en : display_name=Slovenian #Italy, Resian#
120: disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
121: disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
122: -----------------
123: locale='sl_IT_NEDIS_ROJAZ_1901'
124: disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
125: disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
126: disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
127: -----------------
128: locale='i-enochian'
129: disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
130: disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
131: disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
132: -----------------
133: locale='zh-hakka'
134: disp_locale=en : display_name=Chinese( #HAKKA#)?
135: disp_locale=fr : display_name=chinois( #HAKKA#)?
136: disp_locale=de : display_name=Chinesisch( #HAKKA#)?
137: -----------------
138: locale='zh-wuu'
139: disp_locale=en : display_name=Chinese #WUU#
140: disp_locale=fr : display_name=chinois #WUU#
141: disp_locale=de : display_name=Chinesisch #WUU#
142: -----------------
143: locale='i-tay'
144: disp_locale=en : display_name=i-tay
145: disp_locale=fr : display_name=i-tay
146: disp_locale=de : display_name=i-tay
147: -----------------
148: locale='sgn-BE-nl'
149: disp_locale=en : display_name=Sign Languages? #Belgium, NL#
150: disp_locale=fr : display_name=langues? des signes #Belgique, NL#
151: disp_locale=de : display_name=Gebärdensprache #Belgien, NL#
152: -----------------
153: locale='sgn-CH-de'
154: disp_locale=en : display_name=Sign Languages? #Switzerland, DE#
155: disp_locale=fr : display_name=langues? des signes #Suisse, DE#
156: disp_locale=de : display_name=Gebärdensprache #Schweiz, DE#
157: -----------------
158: locale='sl_IT_rozaj@currency=EUR'
159: disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
160: disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, Devise=euro#
161: disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
162: -----------------
163: locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
164: disp_locale=en : display_name=Ukrainian #Ukraine, CALIFORNIA, [Cc]urrency#
165: disp_locale=fr : display_name=ukrainien #Ukraine, CALIFORNIA, Devise#
166: disp_locale=de : display_name=Ukrainisch #Ukraine, CALIFORNIA, Währung#
167: -----------------
168: locale='root'
169: disp_locale=en : display_name=Root
170: disp_locale=fr : display_name=racine
171: disp_locale=de : display_name=[Rr]oot
172: -----------------
173: locale='uk@currency=EURO'
174: disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
175: disp_locale=fr : display_name=ukrainien #Devise=EURO#
176: disp_locale=de : display_name=Ukrainisch #Währung=EURO#
177: -----------------
178: locale='Hindi'
179: disp_locale=en : display_name=hindi
180: disp_locale=fr : display_name=hindi
181: disp_locale=de : display_name=hindi
182: -----------------
183: locale='de'
184: disp_locale=en : display_name=German
185: disp_locale=fr : display_name=allemand
186: disp_locale=de : display_name=Deutsch
187: -----------------
188: locale='fr'
189: disp_locale=en : display_name=French
190: disp_locale=fr : display_name=français
191: disp_locale=de : display_name=Französisch
192: -----------------
193: locale='ja'
194: disp_locale=en : display_name=Japanese
195: disp_locale=fr : display_name=japonais
196: disp_locale=de : display_name=Japanisch
197: -----------------
198: locale='i-enochian'
199: disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
200: disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
201: disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
202: -----------------
203: locale='zh-Hant'
204: disp_locale=en : display_name=Chinese #Traditional#
205: disp_locale=fr : display_name=chinois #idéogrammes han (#variante traditionnelle#|traditionnels)#
206: disp_locale=de : display_name=Chinesisch #Traditionell#
207: -----------------
208: locale='zh-Hans'
209: disp_locale=en : display_name=Chinese #Simplified#
210: disp_locale=fr : display_name=chinois #idéogrammes han (#variante simplifiée#|simplifiés)#
211: disp_locale=de : display_name=Chinesisch #Vereinfacht#
212: -----------------
213: locale='sr-Cyrl'
214: disp_locale=en : display_name=Serbian #Cyrillic#
215: disp_locale=fr : display_name=serbe #cyrillique#
216: disp_locale=de : display_name=Serbisch #Kyrillisch#
217: -----------------
218: locale='sr-Latn'
219: disp_locale=en : display_name=Serbian #Latin#
220: disp_locale=fr : display_name=serbe #latin#
221: disp_locale=de : display_name=Serbisch #Lateinisch#
222: -----------------
223: locale='zh-Hans-CN'
224: disp_locale=en : display_name=Chinese #Simplified, China#
225: disp_locale=fr : display_name=chinois #idéogrammes han (#variante simplifiée#|simplifiés), Chine#
226: disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
227: -----------------
228: locale='sr-Latn-CS'
229: disp_locale=en : display_name=Serbian #Latin, Serbia [aA]nd Montenegro#
230: disp_locale=fr : display_name=serbe #latin, Serbie-et-Monténégro#
231: disp_locale=de : display_name=Serbisch #Lateinisch, Serbien und Montenegro#
232: -----------------
233: locale='sl-rozaj'
234: disp_locale=en : display_name=Slovenian #Resian#
235: disp_locale=fr : display_name=slovène #dialecte de Resia#
236: disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
237: -----------------
238: locale='sl-nedis'
239: disp_locale=en : display_name=Slovenian #Natisone dialect#
240: disp_locale=fr : display_name=slovène #dialecte de Natisone#
241: disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
242: -----------------
243: locale='de-CH-1901'
244: disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
245: disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
246: disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
247: -----------------
248: locale='sl-IT-nedis'
249: disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
250: disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
251: disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
252: -----------------
253: locale='sl-Latn-IT-nedis'
254: disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
255: disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
256: disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
257: -----------------
258: locale='de-DE'
259: disp_locale=en : display_name=German #Germany#
260: disp_locale=fr : display_name=allemand #Allemagne#
261: disp_locale=de : display_name=Deutsch #Deutschland#
262: -----------------
263: locale='en-US'
264: disp_locale=en : display_name=English #United States#
265: disp_locale=fr : display_name=anglais #États-Unis#
266: disp_locale=de : display_name=Englisch #Vereinigte Staaten#
267: -----------------
268: locale='es-419'
269: disp_locale=en : display_name=Spanish #Latin America#
270: disp_locale=fr : display_name=espagnol #Amérique latine#
271: disp_locale=de : display_name=Spanisch #Lateinamerika#
272: -----------------
273: locale='de-CH-x-phonebk'
274: disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
275: disp_locale=fr : display_name=allemand #Suisse, Usage privé=phonebk#
276: disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
277: -----------------
278: locale='az-Arab-x-AZE-derbend'
279: disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
280: disp_locale=fr : display_name=azéri #arabe, Usage privé=aze-derbend#
281: disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
282: -----------------
283: locale='zh-min'
284: disp_locale=en : display_name=Chinese #MIN#
285: disp_locale=fr : display_name=chinois #MIN#
286: disp_locale=de : display_name=Chinesisch #MIN#
287: -----------------
288: locale='zh-min-nan-Hant-CN'
289: disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
290: disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
291: disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
292: -----------------
293: locale='x-whatever'
294: disp_locale=en : display_name=x-whatever #Private-Use=whatever#
295: disp_locale=fr : display_name=x-whatever #Usage privé=whatever#
296: disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
297: -----------------
298: locale='qaa-Qaaa-QM-x-southern'
299: disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
300: disp_locale=fr : display_name=qaa #Qaaa, QM, Usage privé=southern#
301: disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
302: -----------------
303: locale='sr-Latn-QM'
304: disp_locale=en : display_name=Serbian #Latin, QM#
305: disp_locale=fr : display_name=serbe #latin, QM#
306: disp_locale=de : display_name=Serbisch #Lateinisch, QM#
307: -----------------
308: locale='sr-Qaaa-CS'
309: disp_locale=en : display_name=Serbian #Qaaa, Serbia [aA]nd Montenegro#
310: disp_locale=fr : display_name=serbe #Qaaa, Serbie-et-Monténégro#
311: disp_locale=de : display_name=Serbisch #Qaaa, Serbien und Montenegro#
312: -----------------
313: locale='en-US-u-islamCal'
314: disp_locale=en : display_name=English #United States, attribute=islamcal#
315: disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
316: disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
317: -----------------
318: locale='zh-CN-a-myExt-x-private'
319: disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
320: disp_locale=fr : display_name=chinois #Chine, a=myext, Usage privé=private#
321: disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
322: -----------------
323: locale='en-a-myExt-b-another'
324: disp_locale=en : display_name=English #a=myext, b=another#
325: disp_locale=fr : display_name=anglais #a=myext, b=another#
326: disp_locale=de : display_name=Englisch #a=myext, b=another#
327: -----------------
328: locale='de-419-DE'
329: disp_locale=en : display_name=German #Latin America, DE#
330: disp_locale=fr : display_name=allemand #Amérique latine, DE#
331: disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
332: -----------------
333: locale='a-DE'
334: disp_locale=en : display_name=a #Germany#
335: disp_locale=fr : display_name=a #Allemagne#
336: disp_locale=de : display_name=a #Deutschland#
337: -----------------
338: locale='ar-a-aaa-b-bbb-a-ccc'
339: disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
340: disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
341: disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
342: -----------------
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>