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

25,841

Solution 1

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

Solution 2

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

Share:
25,841
culter
Author by

culter

Updated on October 02, 2020

Comments

  • culter
    culter over 3 years

    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>