Social Plugin - Opengraph for multilingual sites

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349814

-- 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.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349819

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

Rolex DATEJUST 31 Oyster, 31 mm, Everose gold
on that page:
i.imgur.com/YnNY9a7.png
And not with the text
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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349864

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.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349866

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:

$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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349880

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.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349884

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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349892

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,

Attachments:

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349895

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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349910

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.

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349911

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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349920

FTP access credentials sent.

Thanks

Sandra

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
1 year 1 month ago #349936

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 :

$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.

  • Posts: 147
  • Thank you received: 12
  • Hikashop Business
1 year 1 month ago #349962

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.058 seconds
Powered by Kunena Forum