Comment to 'Html language tag issue'
  • @Anton L , Thanks for your reply. i have followed your instructions and recreated the English (US) module (en-su) along with another test language module (es-es).

    I replaced everything 'us' with 'en-us'. Same with the other test module where I used 'es-es'.

    Unfortunately, both new language modules don't work. It seems like a bug in UNA. Please investigate.

    Those language modules get installed normally, they show up in polyglot App when editing a language key, I can even select one of them as a default site language, they even show in the language switcher in frontend but they just don't work in the user side.

    What happens is: whenever I select one of them from the language switcher, the URL in the browser address bar changes to mysite.com/lang=en-us or mysite.com/lang=es-es, then nothing happens. The site language doesn't change. Instead, it falls back to the default english (en) module packed with UNA, showing the gb/uk flag in the footer and the name "English" remains selected (in bold) in the language switcher. It doesn't select (doesn't format in bold) the name of the new language I choose in the language switcher, and it doesn't change the flag in the page footer too.

    Also when i go to view the source code of my home page after switching to a new language (e.g: es-es), the 'lang' value in HTML tag falls back to 'en' like this : , instead of .

    But with my old English (US) module using 'us'(before I changed it to 'en-us'), everything works perfectly. When I select the new language from the language switcher, the website url changes to mysite.com/lang=us and the website language changes as well. The language name in the language switcher get selected (in bold), the US flag shows in the page footer and the 'lang' value in HTML tag changes to 'us', although 'us' is not a valide ISO language code. Therefore, it shouldn't be used in the html lang tag. It will affect the SEO. That's why I want to do things correctly and use valide ISO language codes in the HTML lang tag. e.g: 'en', 'es', 'fr' etc.

    There might be a bug in the language system of UNA. It doesn't support two letter language codes with two letter country/region codes (e.g: 'en-us', 'es-es', 'es-mx','fr-fr', 'fr-ca', etc). UNA seems to work with language modules with two letter language only (e.g: 'en', 'es', 'fr' etc). The evidence being my old language module with 'us' working perfectly.

    I am suspecting that the problem is coming from the functions found in inc/classes/BxDolLanguages.php

    Please consider investigating this issue. (I am running UNA 13.1.0-Stable)

    Thanks