diff --git a/Gemfile b/Gemfile index 456fa6a561b..c4dbcbee589 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Rakefile b/Rakefile index 5ec94355237..eba77b8621a 100644 --- a/Rakefile +++ b/Rakefile @@ -21,3 +21,5 @@ begin rescue LoadError STDERR.puts "Run `rake gems:install` to install delayed_job" end +require "i18n-js/rake" + diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7eb6fce021f..dc7e2213ff3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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' diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index f4c291251d9..d59a6d80ac5 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -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 %>