Facebook Like-Box Widget

To adjust the language of the Facebook Like Box, simply change the source path in the JavaScript initialization. You can display the box in German using the following code:


<script type="text/javascript">
   (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>
To display the Facebook Like Box in English, use the following code (other languages can be configured in the same way by using the corresponding language/country codes):

<script type="text/javascript">
   (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) {return;}
      js = d.createElement(s); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&version=v2.0";
      fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>

... back to the blog