Facebook like button, locale not working
Asked Answered
M

2

6

The user can change language on my webpage and I wish to change the text of the fb like button according to the current language. I use the iframe method and have read the documentation from fb but this is not working:

<iframe
  src='http://www.facebook.com/plugins/like.php?locale=en-US&amp;href=http%3A%2F%2Fwww.example.com&amp;layout=button_count&amp;show_faces=false&amp;width=80&amp;action=recommend&amp;colorscheme=light&amp;height=10'
  scrolling='no' frameborder='0'
  style='border:none; overflow:hidden;
  width:80px; height:80px;'
  allowTransparency='true'></iframe>

I have set html lang='en-US' and locale=en-US in the src above but still the text display in my windows locale language.

What am I doing wrong?

Meneau answered 3/3, 2011 at 10:30 Comment(0)
R
9

If i remember right it (the locale= in the iframe address) should be en_US not en-US.

-michael

Rudolf answered 3/3, 2011 at 10:33 Comment(3)
My locale code of the iframe version of the Like button is not working either, but I am using the correct en_US value. It worked for some time, but some days ago it started showing the spanish version of the button, and I did not change anything. Anyone experimenting a similar issue?Wortham
maybe you are logged into facebook with an account that has spanish as default language?Rudolf
@Rudolf please mention me in the comments so that I am notified. Yes, you are right, but that's the reason why I use locale, I want the text to be displayed always in english, not the default. Also, I am pretty sure I was also logged in when some days ago it worked like a charm.Wortham
J
0

You can find a complete listing of all the locales supported by Facebook here:

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

Good luck!

Jacal answered 23/12, 2011 at 17:32 Comment(2)
When I open the page up in Firefox I get an XML-document so if you get a blank page your browser probably doesn't display XML in the browser window. I that case, try a different browser or just right-click and download the file.Jacal
as of May 2017, Facebook removed this file from their servers. I could not find where the XML file went or if it's just gone.Locke

© 2022 - 2024 — McMap. All rights reserved.