I have a grails application with meta og tags like this:
<meta property="og:description" content="${message(code:'description')}"/>
The message properties works fine for i18n if the user's browser send the request. But in case of Facebook it is different. Facebook seems to request alwas the en_US version on my page which means that the meta og tags are always in the wrong language if the user requests the page from a de_DE browser.
Is there a way to tell facebook to use a different request language than en_US?
I tried:
<meta property="og:locale" content="de_DE" />
but this does not change the requested language as well.
What can I do to get the correct i18n?
If you setup some og:locale:alternate
meta tag, Facebook will rescrape the page by passing a get
parameter fb_locale
with the value of the locale. For example, if your site is http://mysite.com/share
and it present these alternative locales:
<html>
<head>
<meta property="og:locale:alternate" content="fr_FR" />
<meta property="og:locale:alternate" content="es_ES" />
...
</head>
...
</html>
Facebook will call these url on your site.
http://mysite.com/share
http://mysite.com/share?fb_locale=fr_FR
http://mysite.com/share?fb_locale=es_ES
You then just need to localize you content (and set og:locale
) correctly.
Doc is here: https://developers.facebook.com/docs/technical-guides/opengraph/internationalization/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With