打开图形本地化 [英] Open Graph Localization

查看:97
本文介绍了打开图形本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在Facebook的OpenGraph中本地化对象吗?

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

我的具体目标是让法语/英语用户能够喜欢相同的URL或Graph对象,同时拥有本地特定的描述会显示在他们的时间表中。到目前为止,我可以实现这一点的唯一方法是拥有两个独立的图形节点,有效地将喜欢的数量分成两半。

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.

我试图提供英文和法文版本我的网页的法语版本使用英文页面的URL作为其规范的URL,但这导致法国用户的英文页面的标题/描述显示在他们的时间表中。

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.

有什么办法可以同时拥有一个共享的like计数的法语和英文版本?

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

推荐答案

您想要的详细文档位于:
https://developers.facebook。 com / docs / beta / opengraph / internationalization /

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

简而言之,您将需要在 og中提供主要区域设置:locale 标签,然后在 og:locale:alternate 标签中的备用语言环境。对于每个备用区域设置,FB刮刀将重新生成页面,但在 fb_locale 查询字符串参数中传递备用区域设置。您应该使用此查询字符串参数,并提供适当的特定于语言环境的元数据。

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.

这篇关于打开图形本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆