Comment to 'Html language tag issue'
  • @Anton L , You are amazing! Thanks a lot for your time and your guidance. You have no idea how helpful your answer is.

    I have just realized that I was doing things wrong and that would have affected how my site language works and also my site SEO. I will have to re-do my language module and change everything from "us" to "en-us". I am on my dev site testing things, so no problem about creating a new module.

    1.1. You said that I don't need to change module's name and uri.

    'name' => 'xxx_us',

    'home_uri' => 'us',

    Question: but as I am re-creating a new language with 'en-us', do I still need to keep them unchanged ('us')?

    home_uri is used to separate language like this: mysite.com/en, mysite.com/fr, etc right?

    2. As I said, for testing purposes, I changed the value of 'Name' to 'fr-fr', 'fr-ca', 'es-es' and 'es-mx' in the `sys_localization_languages` table of my English (US) module.

    Then, I cleaned the site cache and went to check the home page source code on my browser, but nothing happened. The value of 'lang' in the HTML tag remained 'en'. It didn't change to 'fr' or 'es'.

    My Question is: Creating new language modules for fr-fr, fr-ca, es-es and es-mx using the same rules and guidelines you provided to me, will the value of 'lang' in the HTML tag change to 'fr' or 'es' automatically?

    I am really worrying about the HTML lang tag as it's an important tag for SEO and the correct/valid way of using it, is with two-letter codes only (ISO language code).

    By the way, in /inc/classes/BxDolLanguages.php, i saw some functions 'en-us => en' etc. Are those functions the ones controlling the change from 'en-us' to 'en' in the HTML lang tag automatically? (just asking). Will it be necessary to write new functions to automatically change from 'fr-fr => fr' or fr-ca => fr' or 'es-es =>es' or es-mx =>es' or 'pt-pt =>pt' or 'pt-br => pt' etc?

    Thanks