Facebook的 - 分享对话框,切换语言
问题描述:
我使用Facebook的SDK:Facebook的 - 分享对话框,切换语言
window.fbAsyncInit = function() {
FB.init({
appId : 'appid',
xfbml : true,
version : 'v2.2'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/sv_SE/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
分享代码:
window.open('https://www.facebook.com/dialog/feed?app_id=id&display=popup&link=' + url + '&redirect_uri=' + red_url + '&caption=domain.com', 'Facebook', 'height=320, width=640, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
当我使用这与他们的份额对话框中,它看起来是这样的:
请注意,该语言是英语,我该如何改变它,使其遵循正确的语言?
答
Feed对话框已被弃用,您不应该再使用它了。改为使用共享对话框:https://developers.facebook.com/docs/sharing/reference/share-dialog
通过使用FB.ui
,它将采用包含的SDK中的语言。您正试图打开一个没有连接到您的页面的窗口。
不推荐,但如果你真的想用旧料对话,这将是正确的做法:
FB.ui({
method: 'feed',
link: 'absolute url',
name: 'some title',
caption: '---',
description: 'some description',
picture: 'absolute url to share pic'
}, callbackFunction);