Module: L10n::JavaScriptHelper

Defined in:
lib/l10n/javascript_helper.rb

Instance Method Summary collapse

Instance Method Details

#i18n_script_tagObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/l10n/javascript_helper.rb', line 4

def i18n_script_tag
  javascript_tag %<
  var I18n = I18n || {};
  
  I18n.locale = function() {
    return("#{I18n.locale}");
  };
  
  I18n.translations = #{I18n.t(:javascript).to_json};
  >
end