Annotation of embedaddon/php/ext/intl/tests/locale_get_display_language.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: locale_get_display_language()
3: --SKIPIF--
4: <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5: --FILE--
6: <?php
7:
8: /*
9: * Try getting the display_language 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: 'art-lojban', //(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_language( $locale ,$disp_locale );
81: $res_str .= "disp_locale=$disp_locale : display_language=$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_language=Ukrainian
98: disp_locale=fr : display_language=ukrainien
99: disp_locale=de : display_language=Ukrainisch
100: -----------------
101: locale='root'
102: disp_locale=en : display_language=Root
103: disp_locale=fr : display_language=racine
104: disp_locale=de : display_language=[rR]oot
105: -----------------
106: locale='uk@currency=EURO'
107: disp_locale=en : display_language=Ukrainian
108: disp_locale=fr : display_language=ukrainien
109: disp_locale=de : display_language=Ukrainisch
110: -----------------
111: locale='Hindi'
112: disp_locale=en : display_language=hindi
113: disp_locale=fr : display_language=hindi
114: disp_locale=de : display_language=hindi
115: -----------------
116: locale='de'
117: disp_locale=en : display_language=German
118: disp_locale=fr : display_language=allemand
119: disp_locale=de : display_language=Deutsch
120: -----------------
121: locale='fr'
122: disp_locale=en : display_language=French
123: disp_locale=fr : display_language=français
124: disp_locale=de : display_language=Französisch
125: -----------------
126: locale='ja'
127: disp_locale=en : display_language=Japanese
128: disp_locale=fr : display_language=japonais
129: disp_locale=de : display_language=Japanisch
130: -----------------
131: locale='i-enochian'
132: disp_locale=en : display_language=i-enochian
133: disp_locale=fr : display_language=i-enochian
134: disp_locale=de : display_language=i-enochian
135: -----------------
136: locale='art-lojban'
137: disp_locale=en : display_language=Lojban
138: disp_locale=fr : display_language=lojban
139: disp_locale=de : display_language=Lojban
140: -----------------
141: locale='zh-Hant'
142: disp_locale=en : display_language=Chinese
143: disp_locale=fr : display_language=chinois
144: disp_locale=de : display_language=Chinesisch
145: -----------------
146: locale='zh-Hans'
147: disp_locale=en : display_language=Chinese
148: disp_locale=fr : display_language=chinois
149: disp_locale=de : display_language=Chinesisch
150: -----------------
151: locale='sr-Cyrl'
152: disp_locale=en : display_language=Serbian
153: disp_locale=fr : display_language=serbe
154: disp_locale=de : display_language=Serbisch
155: -----------------
156: locale='sr-Latn'
157: disp_locale=en : display_language=Serbian
158: disp_locale=fr : display_language=serbe
159: disp_locale=de : display_language=Serbisch
160: -----------------
161: locale='zh-Hans-CN'
162: disp_locale=en : display_language=Chinese
163: disp_locale=fr : display_language=chinois
164: disp_locale=de : display_language=Chinesisch
165: -----------------
166: locale='sr-Latn-CS'
167: disp_locale=en : display_language=Serbian
168: disp_locale=fr : display_language=serbe
169: disp_locale=de : display_language=Serbisch
170: -----------------
171: locale='sl-rozaj'
172: disp_locale=en : display_language=Slovenian
173: disp_locale=fr : display_language=slovène
174: disp_locale=de : display_language=Slowenisch
175: -----------------
176: locale='sl-nedis'
177: disp_locale=en : display_language=Slovenian
178: disp_locale=fr : display_language=slovène
179: disp_locale=de : display_language=Slowenisch
180: -----------------
181: locale='de-CH-1901'
182: disp_locale=en : display_language=German
183: disp_locale=fr : display_language=allemand
184: disp_locale=de : display_language=Deutsch
185: -----------------
186: locale='sl-IT-nedis'
187: disp_locale=en : display_language=Slovenian
188: disp_locale=fr : display_language=slovène
189: disp_locale=de : display_language=Slowenisch
190: -----------------
191: locale='sl-Latn-IT-nedis'
192: disp_locale=en : display_language=Slovenian
193: disp_locale=fr : display_language=slovène
194: disp_locale=de : display_language=Slowenisch
195: -----------------
196: locale='de-DE'
197: disp_locale=en : display_language=German
198: disp_locale=fr : display_language=allemand
199: disp_locale=de : display_language=Deutsch
200: -----------------
201: locale='en-US'
202: disp_locale=en : display_language=English
203: disp_locale=fr : display_language=anglais
204: disp_locale=de : display_language=Englisch
205: -----------------
206: locale='es-419'
207: disp_locale=en : display_language=Spanish
208: disp_locale=fr : display_language=espagnol
209: disp_locale=de : display_language=Spanisch
210: -----------------
211: locale='de-CH-x-phonebk'
212: disp_locale=en : display_language=German
213: disp_locale=fr : display_language=allemand
214: disp_locale=de : display_language=Deutsch
215: -----------------
216: locale='az-Arab-x-AZE-derbend'
217: disp_locale=en : display_language=Azerbaijani
218: disp_locale=fr : display_language=azéri
219: disp_locale=de : display_language=Aserbaidschanisch
220: -----------------
221: locale='zh-min'
222: disp_locale=en : display_language=Chinese
223: disp_locale=fr : display_language=chinois
224: disp_locale=de : display_language=Chinesisch
225: -----------------
226: locale='zh-min-nan-Hant-CN'
227: disp_locale=en : display_language=Chinese
228: disp_locale=fr : display_language=chinois
229: disp_locale=de : display_language=Chinesisch
230: -----------------
231: locale='x-whatever'
232: disp_locale=en : display_language=x-whatever
233: disp_locale=fr : display_language=x-whatever
234: disp_locale=de : display_language=x-whatever
235: -----------------
236: locale='qaa-Qaaa-QM-x-southern'
237: disp_locale=en : display_language=qaa
238: disp_locale=fr : display_language=qaa
239: disp_locale=de : display_language=qaa
240: -----------------
241: locale='sr-Latn-QM'
242: disp_locale=en : display_language=Serbian
243: disp_locale=fr : display_language=serbe
244: disp_locale=de : display_language=Serbisch
245: -----------------
246: locale='sr-Qaaa-CS'
247: disp_locale=en : display_language=Serbian
248: disp_locale=fr : display_language=serbe
249: disp_locale=de : display_language=Serbisch
250: -----------------
251: locale='en-US-u-islamCal'
252: disp_locale=en : display_language=English
253: disp_locale=fr : display_language=anglais
254: disp_locale=de : display_language=Englisch
255: -----------------
256: locale='zh-CN-a-myExt-x-private'
257: disp_locale=en : display_language=Chinese
258: disp_locale=fr : display_language=chinois
259: disp_locale=de : display_language=Chinesisch
260: -----------------
261: locale='en-a-myExt-b-another'
262: disp_locale=en : display_language=English
263: disp_locale=fr : display_language=anglais
264: disp_locale=de : display_language=Englisch
265: -----------------
266: locale='de-419-DE'
267: disp_locale=en : display_language=German
268: disp_locale=fr : display_language=allemand
269: disp_locale=de : display_language=Deutsch
270: -----------------
271: locale='a-DE'
272: disp_locale=en : display_language=a
273: disp_locale=fr : display_language=a
274: disp_locale=de : display_language=a
275: -----------------
276: locale='ar-a-aaa-b-bbb-a-ccc'
277: disp_locale=en : display_language=Arabic
278: disp_locale=fr : display_language=arabe
279: disp_locale=de : display_language=Arabisch
280: -----------------
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>