Support » Plugin: Polylang » Language codes from each country

  • This is a basic question but can’t find the answer anywhere.

    My site has 4 defined languages en_US (default), es_ES, fr_FR and pt_PT.

    If someone from Spain, France or Portugal access the site will have his own language displaying, but if someone from Mexico, Brazil or United Kingdom make an access the displayed language will be the default in my case en_US.

    The question is:
    To have the site displaying in Spanish for someone from Mexico, should I define a new language es_ME, or is there a way to make the browsers assume just the first two letters of the language code ‘es’?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby


    Not so basic. And interesting!

    I never had such issue because my browser preferences are set as ‘fr_FR’, ‘fr’, ‘en’. So if I go to a Canadian website, I am correctly served the French language. But if I would remove the ‘fr’ of my browser preferences, I would certainly have the kind of issues you describe. I will look for a workaround.

    Plugin Author Chouby


    I reviewed my code. And also made tests (with fr_CA as unique preferred language) on a test fr + en (default). I am correctly served French language at first visit.

    So for you, Mexican people with es_ME as unique preferred language should be served es_ES (provided that you use es as slug)

    This detail makes a huge difference, bouncing rates for example.

    Polylang doing what is suppose to do.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Language codes from each country’ is closed to new replies.