From de2ad3f1a600e39a340b209813e83b816d622194 Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Mon, 24 Oct 2016 12:27:57 +0200 Subject: [PATCH] FATAL -- : ActionController::RoutingError (No route matches [GET] '/plugin_assets/redmine_dmsf/javascripts/jquery.dataTables/zh.json') type:bug #582 --- app/helpers/dmsf_helper.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/dmsf_helper.rb b/app/helpers/dmsf_helper.rb index 7fd503e3..3982c3c0 100644 --- a/app/helpers/dmsf_helper.rb +++ b/app/helpers/dmsf_helper.rb @@ -68,11 +68,13 @@ module DmsfHelper end def json_url - if I18n.locale && !I18n.locale.to_s.match(/^en.*/) - "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" - else - 'jquery.dataTables/en.json' + if I18n.locale + ret = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" + path = "#{File.dirname(__FILE__)}/../../assets/javascripts/#{ret}" + return ret if File.exist?(path) + Rails.logger.warn "#{path} not found" end + 'jquery.dataTables/en.json' end def self.all_children_sorted(parent, pos, ident)