@@ -88,7 +88,9 @@ which defaults to the current default locale::
88
88
$language = Languages::getName('fr', 'de');
89
89
// => 'Französisch'
90
90
91
- You can also check if a given language code is valid::
91
+ If the given locale doesn't exist, the methods trigger a
92
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
93
+ to catching the exception, you can also check if a given language code is valid::
92
94
93
95
$isValidLanguage = Languages::exists($languageCode);
94
96
@@ -121,7 +123,9 @@ which defaults to the current default locale::
121
123
$language = Scripts::getName('Hans', 'de');
122
124
// => 'Vereinfacht'
123
125
124
- You can also check if a given script code is valid::
126
+ If the given script code doesn't exist, the methods trigger a
127
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
128
+ to catching the exception, you can also check if a given script code is valid::
125
129
126
130
$isValidScript = Scripts::exists($scriptCode);
127
131
@@ -156,7 +160,9 @@ which defaults to the current default locale::
156
160
$country = Countries::getName('GB', 'de');
157
161
// => 'Vereinigtes Königreich'
158
162
159
- You can also check if a given country code is valid::
163
+ If the given country code doesn't exist, the methods trigger a
164
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
165
+ to catching the exception, you can also check if a given country code is valid::
160
166
161
167
$isValidCountry = Countries::exists($countryCode);
162
168
@@ -192,7 +198,9 @@ which defaults to the current default locale::
192
198
$locale = Locales::getName('zh_Hans_MO', 'de');
193
199
// => 'Chinesisch (Vereinfacht, Sonderverwaltungsregion Macau)'
194
200
195
- You can also check if a given locale code is valid::
201
+ If the given locale code doesn't exist, the methods trigger a
202
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
203
+ to catching the exception, you can also check if a given locale code is valid::
196
204
197
205
$isValidLocale = Locales::exists($localeCode);
198
206
@@ -236,7 +244,9 @@ the current default locale::
236
244
$currency = Currencies::getName('INR', 'de');
237
245
// => 'Indische Rupie'
238
246
239
- You can also check if a given currency code is valid::
247
+ If the given currency code doesn't exist, the methods trigger a
248
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
249
+ to catching the exception, you can also check if a given currency code is valid::
240
250
241
251
$isValidCurrency = Currencies::exists($currencyCode);
242
252
@@ -314,7 +324,9 @@ you can pass the locale as the third optional argument::
314
324
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'ar')); // $offset = 'غرينتش+01:00'
315
325
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'dz')); // $offset = 'ཇི་ཨེམ་ཏི་+01:00'
316
326
317
- Finally, you can also check if a given timezone ID is valid::
327
+ If the given timezone ID doesn't exist, the methods trigger a
328
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
329
+ to catching the exception, you can also check if a given timezone ID is valid::
318
330
319
331
$isValidTimezone = Timezones::exists($timezoneId);
320
332
0 commit comments