adds i18n-js gem providing us with easier access to translations in js

This commit is contained in:
jwollert
2012-09-03 16:27:42 +02:00
committed by Gregor Schmidt
parent a8530183a8
commit 4511a4e83d
4 changed files with 16 additions and 0 deletions
+2
View File
@@ -10,6 +10,8 @@ gem "rdoc", ">= 2.4.2"
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
gem 'delayed_job', "~>2.0.4"
gem "i18n-js"
group :test do
gem 'shoulda', '~> 2.10.3'
gem 'edavis10-object_daddy', :require => 'object_daddy'
+2
View File
@@ -21,3 +21,5 @@ begin
rescue LoadError
STDERR.puts "Run `rake gems:install` to install delayed_job"
end
require "i18n-js/rake"
@@ -21,6 +21,11 @@ class ApplicationController < ActionController::Base
protected
include Redmine::I18n
before_filter :export_i18n_messages
def export_i18n_messages
SimplesIdeias::I18n.export!
end
layout 'base'
exempt_from_layout 'builder', 'rsb'
+7
View File
@@ -22,6 +22,13 @@
<%= javascript_include_tag 'breadcrumb.js' %>
<%= javascript_include_tag 'chosen.js'%>
<%= stylesheet_link_tag 'chosen'%>
<%= javascript_include_tag "i18n" %>
<%= javascript_include_tag "translations" %>
<% javascript_tag do -%>
I18n.defaultLocale = "<%= I18n.default_locale %>";
I18n.locale = "<%= I18n.locale %>";
<% end %>
<% if User.current.impaired? && accessibility_css_enabled? %>
<%= stylesheet_link_tag 'accessibility' %>
<% end %>