mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
adds i18n-js gem providing us with easier access to translations in js
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in New Issue
Block a user