문제

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. 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.

도움이 되었습니까?

해결책

Facebook will automatically use the appropriate locale based on information from the users browser and account.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top