Skip to content

Commit c3ca2ae

Browse files
committed
minor #11449 Document the new Intl exists() methods (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Document the new Intl exists() methods As mentioned by our friend @ro0NL in this comment: https://symfony.com/blog/new-in-symfony-4-3-simpler-access-to-intl-data#comment-23227 Commits ------- 1ef964e Document the new Intl exists() methods
2 parents 422ff6b + 1ef964e commit c3ca2ae

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

components/intl.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ which defaults to the current default locale::
240240
$languages = Languages::getNames('de');
241241
// => ['ab' => 'Abchasisch', ...]
242242

243+
You can also check if a given language code is valid::
244+
245+
$isValidLanguage = Languages::exists($languageCode);
246+
243247
.. versionadded:: 4.3
244248

245249
The ``Languages`` class was introduced in Symfony 4.3.
@@ -259,6 +263,10 @@ for traditional Chinese)::
259263
$script = Scripts::getName('Hans');
260264
// => 'Simplified'
261265

266+
You can also check if a given script code is valid::
267+
268+
$isValidScript = Scripts::exists($scriptCode);
269+
262270
.. versionadded:: 4.3
263271

264272
The ``Scrcipts`` class was introduced in Symfony 4.3.
@@ -288,6 +296,10 @@ which defaults to the current default locale::
288296
$countries = Regions::getNames('de');
289297
// => ['AF' => 'Afghanistan', ...]
290298

299+
You can also check if a given region code is valid::
300+
301+
$isValidRegion = Regions::exists($regionCode);
302+
291303
.. versionadded:: 4.3
292304

293305
The ``Regions`` class was introduced in Symfony 4.3.
@@ -316,6 +328,10 @@ which defaults to the current default locale::
316328
$locales = Locales::getNames('de');
317329
// => ['af' => 'Afrikaans', ...]
318330

331+
You can also check if a given locale code is valid::
332+
333+
$isValidLocale = Locales::exists($localeCode);
334+
319335
.. versionadded:: 4.3
320336

321337
The ``Locales`` class was introduced in Symfony 4.3.
@@ -352,6 +368,10 @@ the current default locale::
352368
$currencies = Currencies::getNames('de');
353369
// => ['AFN' => 'Afghanische Afghani', ...]
354370

371+
You can also check if a given currency code is valid::
372+
373+
$isValidCurrency = Currencies::exists($currencyCode);
374+
355375
.. versionadded:: 4.3
356376

357377
The ``Currencies`` class was introduced in Symfony 4.3.

0 commit comments

Comments
 (0)