mediapop / django-friendface

Getting Facebook to work for Django.
2 stars 0 forks source link

Facebook init templattag that also picks the correct language. #41

Open kitsunde opened 11 years ago

kitsunde commented 11 years ago

It should pick the closest relative i.e. if the language is id. It should pick id_ID.

{% facebook_init %}

Produces

(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=1234567890";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

Facebook supports these languages: https://www.facebook.com/translations/FacebookLocales.xml