@@ -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
@@ -117,7 +119,9 @@ which defaults to the current default locale::
117
119
$language = Scripts::getName('Hans', 'de');
118
120
// => 'Vereinfacht'
119
121
120
- You can also check if a given script code is valid::
122
+ If the given script code doesn't exist, the methods trigger a
123
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
124
+ to catching the exception, you can also check if a given script code is valid::
121
125
122
126
$isValidScript = Scripts::exists($scriptCode);
123
127
@@ -148,7 +152,9 @@ which defaults to the current default locale::
148
152
$country = Countries::getName('GB', 'de');
149
153
// => 'Vereinigtes Königreich'
150
154
151
- You can also check if a given country code is valid::
155
+ If the given country code doesn't exist, the methods trigger a
156
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
157
+ to catching the exception, you can also check if a given country code is valid::
152
158
153
159
$isValidCountry = Countries::exists($countryCode);
154
160
@@ -180,7 +186,9 @@ which defaults to the current default locale::
180
186
$locale = Locales::getName('zh_Hans_MO', 'de');
181
187
// => 'Chinesisch (Vereinfacht, Sonderverwaltungsregion Macau)'
182
188
183
- You can also check if a given locale code is valid::
189
+ If the given locale code doesn't exist, the methods trigger a
190
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
191
+ to catching the exception, you can also check if a given locale code is valid::
184
192
185
193
$isValidLocale = Locales::exists($localeCode);
186
194
@@ -220,7 +228,9 @@ the current default locale::
220
228
$currency = Currencies::getName('INR', 'de');
221
229
// => 'Indische Rupie'
222
230
223
- You can also check if a given currency code is valid::
231
+ If the given currency code doesn't exist, the methods trigger a
232
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
233
+ to catching the exception, you can also check if a given currency code is valid::
224
234
225
235
$isValidCurrency = Currencies::exists($currencyCode);
226
236
@@ -294,7 +304,9 @@ you can pass the locale as the third optional argument::
294
304
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'ar')); // $offset = 'غرينتش+01:00'
295
305
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'dz')); // $offset = 'ཇི་ཨེམ་ཏི་+01:00'
296
306
297
- Finally, you can also check if a given timezone ID is valid::
307
+ If the given timezone ID doesn't exist, the methods trigger a
308
+ :class: `Symfony\\ Component\\ Intl\\ Exception\\ MissingResourceException `. In addition
309
+ to catching the exception, you can also check if a given timezone ID is valid::
298
310
299
311
$isValidTimezone = Timezones::exists($timezoneId);
300
312
0 commit comments