Skip to main content

Social Plugin - Opengraph for multilingual sites

More
3 years 6 months ago #349814 by Sandra74
-- url of the page with the problem -- : rolex.jewelrygoldfinger.com/fr/collection/datejust/m278275-0010
-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.1.14

Hi,

My website is in 2 languages.

The information displayed in English (US) on Facebook are correct but when I share a page in French, the information displayed are in English and not in French.

Could you please tell me how I can have the card displayed in the correct language?

Thanks in advance

Sandra

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349819 by nicolas
Hi,

That's strange. The opengraph meta tags added to the headers of the page do seem to be added by the social plugin.
However, as I can see with the Google plus javascript, it sees the current language as being French:
i.imgur.com/KRc7R1i.png
Also, this works fine on my end. I do get the current language text in there.
Another strange thing is that the description meta tag uses the product description. However, if I look at the HTML of your page, the description starts with the text
Code:
Rolex DATEJUST 31 Oyster, 31 mm, Everose gold
on that page:
i.imgur.com/YnNY9a7.png
And not with the text
Code:
Discover the Rolex Datejust watch in Gold and Coloured dial, Dark dial
I can see in the meta tags.
Where does that text comes from ? Or was the layout of the page changed so that something else is displayed in the description area instead of just the description ?

And how do you manage the translations ? Are you using Falang ? Or only the native translation system in HikaShop ?

We might need a backend and FTP access in order to dig into the matter to better understand what's going on...

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349864 by Sandra74
Hi Nicolas,

I edited the plugin so that it uses the meta title and the meta description of the product (as on the site, the title is a language string and the description doesn't contain the needed information).

Regarding the translations, I'm using the Hikashop System.

I can grant you FTP and admin access without any issue.
I have the same issue on another site set up in the same way: tudor.jewelrygoldfinger.com/fr/collectio...ack-bay/m79230r-0012

Thanks in advance for your help

Sandra

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349866 by nicolas
Hi,

Then the issue must come from the code you modified.
I looked at your previous messages on the forum and found this:
www.hikashop.com/forum/product-category-...cription.html#349369
This is fine, but it will only handle the translations if you're using Falang.
Without Falang, you need to use instead the code:
Code:
$ret->name = hikashop_translate($element->product_page_title); $ret->description = hikashop_translate($element->product_meta_description);
This is not needed for the product_name and product_description as it is handled automatically when the product data is loaded.

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349880 by Sandra74
Thanks a lot.

It's now correctly displayed in French.
But not anymore in en-US, which now displays the French version too.
(en-US is my default language)

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349884 by nicolas
Hi,

I can see the fix works fine for both languages on tudor.jewelrygoldfinger.com/fr/collectio...ack-bay/m79230r-0012
So I think it's just that you have the French translation for the meta description in the en-US translation popup.
You need to check the en-US translations for the page title and meta description of that product.

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349892 by Sandra74
For the American version, it's displayed in French, as you can see on my screenshot.

In fact, I have no content in the 'en-US' pop-up, I have the US version on the main screen, else it would have meant entering the english version twice,

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349895 by nicolas
Hi,

But then, you confirm that it fixes the problem on the other website, right ?
Then, I can only think it's a setup issue on that website.
Could you provide a backend access so that I could check the situation ?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349910 by Sandra74
Hi Nicolas,

Nope, it doesn't work on the other site either.

Your backend access is still enable. I'll send you again your credentials.

Thanks

Sandra

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349911 by nicolas
Hi,

Then we'll also need a FTP access in order to do some debugging. Could you also provide one please ?

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349920 by Sandra74
FTP access credentials sent.

Thanks

Sandra

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349936 by nicolas
Hi,

I'm not sure why it does this. I had to reset the language overrides with this code before the first call to hikashop_translate :
Code:
$lang = JFactory::getLanguage(); $configClass = hikashop_config(); $override_path = hikashop_getLanguagePath(JPATH_ROOT).DS.'overrides'.DS.$lang->getTag().'.override.ini'; if(file_exists($override_path) && $lang->getTag() != 'en-GB' && $configClass->get('multi_language_edit') && $configClass->get('language_files_forced_reload', 1)) { $resetOverride = function() { $this->override = array(); $this->strings = array(); if(!empty($this->paths)) { foreach($this->paths as $extension => $files) { if(!empty($files)) { foreach($files as $file => $result) { if(!$result) continue; if(strpos($file, '/overrides/en-GB')) continue; $strings = $this->parse($file); $this->strings = array_replace($this->strings, $strings); } } } } }; $lang = JFactory::getLanguage(); $resetOverrideCB = $resetOverride->bindTo($lang, 'JLanguage'); $resetOverrideCB(); } $lang->load(HIKASHOP_COMPONENT,JPATH_SITE); if(file_exists($override_path)) { hikashop_loadTranslationFile($override_path); }

Please Log in or Create an account to join the conversation.

More
3 years 6 months ago #349962 by Sandra74
Hi Nicolas,

Thanks a lot! It now works like a charm.

Thanks again for your help

Sandra
The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

Time to create page: 0.263 seconds
Powered by Kunena Forum