@@ -212,7 +212,7 @@ Accessing ICU Data
212
212
This component provides the following ICU data:
213
213
214
214
* `Language and Script Names `_
215
- * `Country and Region Names `_
215
+ * `Country Names `_
216
216
* `Locales `_
217
217
* `Currencies `_
218
218
* `Timezones `_
@@ -283,42 +283,40 @@ You can also check if a given script code is valid::
283
283
284
284
The ``Scripts `` class was introduced in Symfony 4.3.
285
285
286
- .. _country-names :
286
+ Country Names
287
+ ~~~~~~~~~~~~~
287
288
288
- Country and Region Names
289
- ~~~~~~~~~~~~~~~~~~~~~~~~
289
+ The ``Countries `` class provides access to the name of all countries according
290
+ to the `ISO 3166-1 alpha-2 `_ list of officially recognized countries and
291
+ territories::
290
292
291
- In the world there are some territorial disputes that make it hard to define
292
- what a country is. That's why the Intl component provides a ``Regions `` class
293
- instead of a ``Countries `` class::
294
-
295
- use Symfony\Component\Intl\Regions;
293
+ use Symfony\Component\Intl\Countries;
296
294
297
295
\Locale::setDefault('en');
298
296
299
- $countries = Regions ::getNames();
300
- // ('regionCode ' => 'regionName ')
297
+ $countries = Countries ::getNames();
298
+ // ('countryCode ' => 'countryName ')
301
299
// => ['AF' => 'Afghanistan', 'AX' => 'Åland Islands', ...]
302
300
303
- $country = Regions ::getName('GB');
301
+ $country = Countries ::getName('GB');
304
302
// => 'United Kingdom'
305
303
306
304
All methods accept the translation locale as the last, optional parameter,
307
305
which defaults to the current default locale::
308
306
309
- $countries = Regions ::getNames('de');
307
+ $countries = Countries ::getNames('de');
310
308
// => ['AF' => 'Afghanistan', 'EG' => 'Ägypten', ...]
311
309
312
- $country = Regions ::getName('GB', 'de');
310
+ $country = Countries ::getName('GB', 'de');
313
311
// => 'Vereinigtes Königreich'
314
312
315
- You can also check if a given region code is valid::
313
+ You can also check if a given country code is valid::
316
314
317
- $isValidRegion = Regions ::exists($regionCode );
315
+ $isValidCountry = Countries ::exists($countryCode );
318
316
319
317
.. versionadded :: 4.3
320
318
321
- The ``Regions `` class was introduced in Symfony 4.3.
319
+ The ``Countries `` class was introduced in Symfony 4.3.
322
320
323
321
Locales
324
322
~~~~~~~
@@ -451,3 +449,4 @@ Learn more
451
449
.. _install the intl extension : https://php.net/manual/en/intl.setup.php
452
450
.. _ICU library : http://site.icu-project.org/
453
451
.. _`Unicode ISO 15924 Registry` : https://www.unicode.org/iso15924/iso15924-codes.html
452
+ .. _`ISO 3166-1 alpha-2` : https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
0 commit comments