Open Graph Localization

自闭症网瘾萝莉.ら 提交于 2020-01-13 11:33:52

问题


Is it possible to localize objects in Facebook's OpenGraph?

My specific goal is having French/English users able to like the same URL or Graph object, while having local-specific descriptions appear in their timelines. So far the only way I can achieve this is having two separate graph nodes, effectively dividing the number of likes in half.

I've attempted to provide English and French versions of my page, with the French version using the English page's URL as its canonical URL, but this results in the French user's having the English page's title/description appear in their timeline.

Is there any way of having both French and English versions of the page while having one shared "like" count?


回答1:


The detailed docs you want are here: https://developers.facebook.com/docs/beta/opengraph/internationalization/

In short, you'll want to provide a primary locale in the og:locale tag, and then alternate locales in the og:locale:alternate tag. For each alternate locale, the FB scraper will rescrape the page, but pass in the alternate locale in the fb_locale query string parameter. You should take this query string parameter and provide the appropriate locale-specific meta data.



来源:https://stackoverflow.com/questions/8039642/open-graph-localization

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