mark-b Posted October 8, 2013 Share Posted October 8, 2013 what is the Language code $? (en-us) I need this for my header script. The $ what i'm looking for is not $lang_iso Please help Link to comment Share on other sites More sharing options...
tuk66 Posted October 9, 2013 Share Posted October 9, 2013 $language.iso_code $language.language_code ? 1 Link to comment Share on other sites More sharing options...
NemoPS Posted October 9, 2013 Share Posted October 9, 2013 In addition to what tuk66 said, where do you need to get this? Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 I'm building the tag for multilingual sites for in the header: rel="alternate" hreflang="x" Link to comment Share on other sites More sharing options...
NemoPS Posted October 9, 2013 Share Posted October 9, 2013 Oh, in this case it is {$meta_language} Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 Yes, but google does not support that tag anymore... https://support.google.com/webmasters/answer/189077?hl=en rel="alternate" hreflang="x" is required when you taget uk customers with /gb/ and if you also target US customers with /en/ Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 both did not work by the way we are building an module for this issue: $language.iso_code $language.language_code Link to comment Share on other sites More sharing options...
NemoPS Posted October 9, 2013 Share Posted October 9, 2013 I don't understand, if you use rel="alternate" hreflang="{$meta_language}" You'll have exactly what google expects Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 if you have 3 languages, it should be like this in the index page of one of the languages in the header: <link rel="alternate" hreflang="en-gb" href="http://www.domain.com/gb/" /> <link rel="alternate" hreflang="en " href="http://www.domain.com/en/" /> <link rel="alternate" hreflang="de" href="http://www.domain.com/de/ " /> Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 this tag is also needed when you want to target for eg French speaking customers in Canada <link rel="alternate" hreflang="fr-ca" href="http://www.domain.com/ca/" /> Link to comment Share on other sites More sharing options...
NemoPS Posted October 9, 2013 Share Posted October 9, 2013 I see. In this case, as far as I know Prestashop only provides the language code (en) without the country code (gb, us, etc). I think you need to create a module for this (please, anybody correct me if I am mistaken!) Now, are you looking for php to automaticaly recognize the user country? Or do you want to set it from the back office? The second case will be easier to achieve, of course Link to comment Share on other sites More sharing options...
mark-b Posted October 9, 2013 Author Share Posted October 9, 2013 set it from the back office Link to comment Share on other sites More sharing options...
NemoPS Posted October 9, 2013 Share Posted October 9, 2013 In this case, I suggest you create a list of the countries you want to support. Place them in an array Then, in the module's back office, grasb all your languages (Language::getLanguages(true)) At this point, for each language, use another foreach loop to run through all countries and add them to a select box. Basically, you want to assign a country to each language ID. Save entries to a new table, like id_lang, id_country Then, in the hook function you use to print out links, grab your settings. For each of them, you can assign the id_lang-id_country pair based on what you decide (i.e. the link you are displaying) Link to comment Share on other sites More sharing options...
HH Services Limited Posted July 26, 2014 Share Posted July 26, 2014 (edited) So If I paste this: <link rel="alternate" hreflang="en" href="http://www.goodpsychologists.com/en/" /> <link rel="alternate" hreflang="es" href="http://www.goodpsychologists.com/es/" /> In the head section of the header.tpl file in the theme/defaultbootstrap directory, do I solve the google requirement for having my site in spanish and english? Thank you Edited July 27, 2014 by npr321 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts