Skip to content

Commit c782937

Browse files
committed
Merge branch '4.4'
* 4.4: [Intl] Mention that all methods trigger exceptions
2 parents dd515d9 + 60ad7ea commit c782937

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

components/intl.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ which defaults to the current default locale::
8888
$language = Languages::getName('fr', 'de');
8989
// => 'Französisch'
9090

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::
9294

9395
$isValidLanguage = Languages::exists($languageCode);
9496

@@ -117,7 +119,9 @@ which defaults to the current default locale::
117119
$language = Scripts::getName('Hans', 'de');
118120
// => 'Vereinfacht'
119121

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::
121125

122126
$isValidScript = Scripts::exists($scriptCode);
123127

@@ -148,7 +152,9 @@ which defaults to the current default locale::
148152
$country = Countries::getName('GB', 'de');
149153
// => 'Vereinigtes Königreich'
150154

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::
152158

153159
$isValidCountry = Countries::exists($countryCode);
154160

@@ -180,7 +186,9 @@ which defaults to the current default locale::
180186
$locale = Locales::getName('zh_Hans_MO', 'de');
181187
// => 'Chinesisch (Vereinfacht, Sonderverwaltungsregion Macau)'
182188

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::
184192

185193
$isValidLocale = Locales::exists($localeCode);
186194

@@ -220,7 +228,9 @@ the current default locale::
220228
$currency = Currencies::getName('INR', 'de');
221229
// => 'Indische Rupie'
222230

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::
224234

225235
$isValidCurrency = Currencies::exists($currencyCode);
226236

@@ -294,7 +304,9 @@ you can pass the locale as the third optional argument::
294304
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'ar')); // $offset = 'غرينتش+01:00'
295305
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'), 'dz')); // $offset = 'ཇི་ཨེམ་ཏི་+01:00'
296306

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::
298310

299311
$isValidTimezone = Timezones::exists($timezoneId);
300312

0 commit comments

Comments
 (0)