Language codes from each country (4 posts)

  1. miguelcortereal
    Posted 2 years ago #

    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'?


  2. Chouby
    Plugin Author

    Posted 2 years ago #

    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.

  3. Chouby
    Plugin Author

    Posted 2 years ago #

    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)

  4. miguelcortereal
    Posted 2 years ago #

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

    Polylang doing what is suppose to do.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Polylang
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.