use :locale parameter in options to set locale of fb-connect javascript assets

This commit is contained in:
Reiner Dieterich 2010-07-29 14:19:06 +02:00
parent 9ab4a4603e
commit 2a326d141e

View File

@ -7,6 +7,7 @@ module Facebooker2
cookie = opts[:cookie] cookie = opts[:cookie]
status = opts[:status] status = opts[:status]
xfbml = opts[:xfbml] xfbml = opts[:xfbml]
locale = options[:locale] || "en_US"
extra_js = capture(&proc) if block_given? extra_js = capture(&proc) if block_given?
js = <<-JAVASCRIPT js = <<-JAVASCRIPT
<script> <script>
@ -25,7 +26,7 @@ module Facebooker2
s.setAttribute('id','fb-root'); s.setAttribute('id','fb-root');
document.documentElement.getElementsByTagName("HEAD")[0].appendChild(s); document.documentElement.getElementsByTagName("HEAD")[0].appendChild(s);
var e = document.createElement('script'); var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.src = document.location.protocol + '//connect.facebook.net/#{locale}/all.js';
e.async = true; e.async = true;
s.appendChild(e); s.appendChild(e);
}()); }());