[英]Localising Facebook Login using Javascript SDK
I am trying to localise the pop-up login box shown using FB.login() under the Javascript SDK but the dialog only displays in English. 我正在尝试本地化使用Javascript SDK下的FB.login()显示的弹出式登录框,但该对话框仅显示为英文。 I use the code below to connect: 我使用下面的代码连接:
var facebookScript = "//connect.facebook.net/fr_FR/all.js"
$.ajaxSetup({ cache: true });
$.getScript(facebookScript, function () {
FB.init({
appId: SOCIAL_FACEBOOK_APP_ID,
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
FB.getLoginStatus(function () {
// At some point here FB.login() is called.
}, true);
});
I notice that if I take the URL of the login box and add &locale=fr_FR
to it I get the desired result. 我注意到,如果我获取登录框的URL并向其添加&locale=fr_FR
,我会得到所需的结果。
Facebook will automatically use the appropriate locale based on information from the users browser and account. Facebook将根据用户浏览器和帐户中的信息自动使用适当的区域设置。
The localized versions of the SDK is mostly to make a few adaptions that need to happen on the third party site, mostly around left-to-right/right-to-left languages, and some labels. SDK的本地化版本主要是为了在第三方网站上进行一些调整,主要是从左到右/从右到左的语言,以及一些标签。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.