Supporting multiple locales for a shared page in facebook

回眸只為那壹抹淺笑 提交于 2020-01-07 06:51:38

问题


I'm attempting to have multiple title and descriptions for a same endpoint, one per language.

Trying to follow this documentation: https://developers.facebook.com/docs/opengraph/guides/internationalization#objects

I have a server that detects when the client is a bot, for example facebook bot, and it renders a single file with the title and description metas, and the following localization metas. I have a file for each language, and I set og:locale depending on the localization fb_locale that I recieve on the queryparams.

meta(property="og:locale" content="en_gb")
meta(property="og:locale:alternate" content="es_es")
meta(property="og:locale:alternate" content="it_it")

How can I have multiple language for the same endpoint? This is my testing app and endpoint I'm trying to translate: https://webapp-server-21b.herokuapp.com/marcp

It seems that it crawls it properly, but does not display the preview in the language I expect when I share it on FB or in the debugger of facebook.

If I perform :

curl -X POST -F "id=https://webapp-server-21b.herokuapp.com/marcp" -F "scrape=true" -F "locale=en_gb" "https://graph.facebook.com" -s

or:

curl -X POST -F "id=https://webapp-server-21b.herokuapp.com/marcp" -F "scrape=true" -F "locale=es_es" "https://graph.facebook.com" -s

I get the expected title in the corresponding expected language, but when I share on facebook or in the debugger it's always in english, the default locale.

Thanks!

来源:https://stackoverflow.com/questions/41738381/supporting-multiple-locales-for-a-shared-page-in-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!