开发者

How can the language of the Facebook "like" button be changed?

I use Facebook like button on my web page with Facebook comments plugin and until now it works oK. Today I realized that it displays in three different languages (English, Czech and Slovak) in three different browsers. The problem is with different width of each language. Here I've tried to change en_开发者_运维问答US to sk, but with no effect:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script src="http://connect.facebook.net/en_US/all.js"></script>


Change your script request to one supported by FB. In my case, i switched form english to spanish bo doing this:

before

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

after

 js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";

Available options in

https://www.facebook.com/translations/FacebookLocales.xml


As @tomasbarrios already said, the language pointed out in the URL, for the DEFAULT language of the text. However, if a person has her/his Facebook account already open, such setting is superseded by the default language of THE ACCOUNT'S language. But that will change according to each individual's own settings, which is a desirable behavior.

To add to the already good note by @tomasbarrios , I add this complementary link, that might help you contextualize, that Facebook's official docs don't offer a better list for that: https://developers.facebook.com/docs/internationalization#locales (a typical case of a poor official documentation...)

In the site blogtricks you will find a better reading than that of the official documentation, at least for beginners in this specific point: http://www.mybloggertricks.com/2011/06/facebook-like-and-send-button-in-108.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜