-1

I was going through the documentation, checking iso 2 digit country codes but I can't wrap my head around this. Everyone in the documentation it says that the 2 digit country code for Sweden is SV, yet it gives "El Salvador" back, when using this function

\Locale::getDisplayRegion('-SV', 'en')

According to this site (and other sites as well), El Salvador should be "es-SV" and Sweden should be "SV" or "sv-SE". Let's say SV doesn't exist at all in the \Locale "db", but then why would it return El Salvador (which is "es-SV") and not Sweden (which is "sv-SE").

To be fair, it does return Sweden for "es-SV", but I think it's confusing.

Does anybody have a clue why is this happening?

Narc0t1CYM
  • 499
  • 6
  • 25
  • 2
    'sv' is the language code, while 'SE' is the country code. `sv-SE` = Svenska-Sverige, `es-SV` = Spanska-Salavador. – Anuga Sep 06 '21 at 11:25

1 Answers1

4

I think you are confusing the ISO 3166-1 alpha-2 country code of Sweden (SE) with the ISO 639-1 language code of Swedish (SV).

The country code SV is indeed El-Salvador.

In the country locale sv-SE, the sv part means the language code (Swedish), and the SE part means the country code (Sweden), mostly distinguishing it from sv-FI, which is the variant of Swedish spoken/written in Finland (FI).

Xyz
  • 5,955
  • 5
  • 40
  • 58
  • Thank you for clarifying that! Much better answer than the one that has already been deleted under my post. – Narc0t1CYM Sep 06 '21 at 11:29