Localize Facebook OG Tags

I have a webpage that uses Facebook og tags . The website is in German (de) and also in English (en).

I use the following og tags in the page header:

 <meta property="fb:app_id" content="34545345353453" /> <meta property="og:site_name" content="mysite.com"> <meta property="og:locale" content="de_DE" /> <meta property="og:locale:alternate" content="en_US" /> <meta property="og:type" name="og:type" content="website"/> <meta property="og:title" name="og:title" content="${message(code:'page.title.home.index')}"/> <meta property="og:description" name="og:description" content="${message(code:'page.meta.description')}"/> 

The problem is that when I post http://www.mysite.com to facebook, I only get the preview in English, even if the main language is German.

How can I get the translation to be German if it is published by someone who has facebook in German and English by someone like English in English?

It works for actions, so it should also work if you use go tags.

+6
source share
1 answer

Have you tried the 'locale' og pseudo?

Check this out: https://developers.facebook.com/docs/opengraph/guides/internationalization/

-2
source

Source: https://habr.com/ru/post/953158/


All Articles