title: Facebook javascript in different languages
body: <p>My facebook javascript that I added to uses the "like" button from facebook and other components, looks like this:</p>
  
  <pre><code>&lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script&gt;
    window.fbAsyncInit = function() {
      FB.init({
        appId      : '164355773607006', // App ID
        channelURL : '//WWW.KOOLBUSINESS.COM/static/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        oauth      : true, // enable OAuth 2.0
        xfbml      : true  // parse XFBML
      });
  
      // Additional initialization code here
    };
    // Load the SDK Asynchronously
    (function(d){
       var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
       js = d.createElement('script'); js.id = id; js.async = true;
       {% ifequal host "www.montao.com.br" %}
       js.src = "//connect.facebook.net/pt_BR/all.js";
       {% else %}
       js.src = "//connect.facebook.net/en_US/all.js";
       {% endifequal %}
       d.getElementsByTagName('head')[0].appendChild(js);
     }(document));
  &lt;/script&gt;
  </code></pre>
  
  <p>Can I put it at the bottom of the pages instead of at the top since that will load the page faster?</p>
  
  <p>How do I check that the channel file is working?</p>
  
  <p>Can my channel file be on another domain, though it is the same app (my app serves multiple comains)?</p>
  
  <p>Is there another way for my server to access the session than with cookies?</p>
  
  <p>Is there a better was to switch between Portuguese and English than I did? My way works but perhaps is inferior. A better way could look for HTTP ACCEPT_LANGUAGE or cookie or http get parameter for language. In this case one domain should alway be in portuguese but it would be nice to switch the language on the FB components when a switch my app's languages with the django_language_cookie. So I suppose I could read the django_language_cookie with javascript instead of checking the domain, but then I'd have to learn how to do it.</p>
  
  <p>Can you comment or help me with my solution? </p>
  
  <p>Thank you</p>