@@ -240,6 +240,10 @@ which defaults to the current default locale::
240
240
$languages = Languages::getNames('de');
241
241
// => ['ab' => 'Abchasisch', ...]
242
242
243
+ You can also check if a given language code is valid::
244
+
245
+ $isValidLanguage = Languages::exists($languageCode);
246
+
243
247
.. versionadded :: 4.3
244
248
245
249
The ``Languages `` class was introduced in Symfony 4.3.
@@ -259,6 +263,10 @@ for traditional Chinese)::
259
263
$script = Scripts::getName('Hans');
260
264
// => 'Simplified'
261
265
266
+ You can also check if a given script code is valid::
267
+
268
+ $isValidScript = Scripts::exists($scriptCode);
269
+
262
270
.. versionadded :: 4.3
263
271
264
272
The ``Scrcipts `` class was introduced in Symfony 4.3.
@@ -288,6 +296,10 @@ which defaults to the current default locale::
288
296
$countries = Regions::getNames('de');
289
297
// => ['AF' => 'Afghanistan', ...]
290
298
299
+ You can also check if a given region code is valid::
300
+
301
+ $isValidRegion = Regions::exists($regionCode);
302
+
291
303
.. versionadded :: 4.3
292
304
293
305
The ``Regions `` class was introduced in Symfony 4.3.
@@ -316,6 +328,10 @@ which defaults to the current default locale::
316
328
$locales = Locales::getNames('de');
317
329
// => ['af' => 'Afrikaans', ...]
318
330
331
+ You can also check if a given locale code is valid::
332
+
333
+ $isValidLocale = Locales::exists($localeCode);
334
+
319
335
.. versionadded :: 4.3
320
336
321
337
The ``Locales `` class was introduced in Symfony 4.3.
@@ -352,6 +368,10 @@ the current default locale::
352
368
$currencies = Currencies::getNames('de');
353
369
// => ['AFN' => 'Afghanische Afghani', ...]
354
370
371
+ You can also check if a given currency code is valid::
372
+
373
+ $isValidCurrency = Currencies::exists($currencyCode);
374
+
355
375
.. versionadded :: 4.3
356
376
357
377
The ``Currencies `` class was introduced in Symfony 4.3.
0 commit comments