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