Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reload I18n when precompiling the date_picker_i18n.js asset

  • Loading branch information...
commit a7ae25c87dc11c7d67a9c6b1382cf98549e1d3ef 1 parent 0eedec0
Didier Lafforgue authored
View
2  Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- locomotive_cms (2.0.0.rc11)
+ locomotive_cms (2.0.0.rc12)
RedCloth (~> 4.2.8)
actionmailer-with-request (~> 0.3.0)
bson_ext (~> 1.5.2)
View
6 vendor/assets/javascripts/locomotive/datepicker_i18n.js.erb
@@ -1,5 +1,11 @@
<%# encoding: utf-8 %>
+<%# FIXME: Assets precompilation requires to load the I18n since we disable the config.assets.initialize_on_precompile option %>
+<% if !I18n.backend.initialized? && I18n.t('locomotive.locales.en', :locale => :en, :default => '').blank? %>
+ <% I18n.load_path += Dir[Locomotive::Engine.root.join('config', 'locales', '**/*.{rb,yml}').to_s] %>
+ <% I18n.reload! %>
+<% end %>
+
jQuery(function($){
<% Locomotive.config.locales.each do |locale| %>
<% I18n.with_locale(locale) do %>
Please sign in to comment.
Something went wrong with that request. Please try again.