diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb
index e1351811..ee2dc557 100644
--- a/app/controllers/dmsf_files_controller.rb
+++ b/app/controllers/dmsf_files_controller.rb
@@ -33,6 +33,7 @@ class DmsfFilesController < ApplicationController
helper :all
helper :dmsf_workflows
+ helper :dmsf
def view
begin
diff --git a/app/helpers/dmsf_helper.rb b/app/helpers/dmsf_helper.rb
index 3982c3c0..383eb82c 100644
--- a/app/helpers/dmsf_helper.rb
+++ b/app/helpers/dmsf_helper.rb
@@ -69,7 +69,7 @@ module DmsfHelper
def json_url
if I18n.locale
- ret = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json"
+ ret = "jquery.dataTables/#{I18n.locale}.json"
path = "#{File.dirname(__FILE__)}/../../assets/javascripts/#{ret}"
return ret if File.exist?(path)
Rails.logger.warn "#{path} not found"
@@ -77,6 +77,16 @@ module DmsfHelper
'jquery.dataTables/en.json'
end
+ def js_url
+ if I18n.locale
+ ret = "plupload/js/i18n/#{I18n.locale}.js"
+ path = "#{File.dirname(__FILE__)}/../../assets/javascripts/#{ret}"
+ return ret if File.exist?(path)
+ Rails.logger.warn "#{path} not found"
+ end
+ 'plupload/js/i18n/en.js'
+ end
+
def self.all_children_sorted(parent, pos, ident)
# Folders && files && links
nodes = parent.dmsf_folders.visible + parent.dmsf_links.visible + parent.dmsf_files.visible
diff --git a/app/views/dmsf_files/show.html.erb b/app/views/dmsf_files/show.html.erb
index 7c53f8b1..b14b6c70 100644
--- a/app/views/dmsf_files/show.html.erb
+++ b/app/views/dmsf_files/show.html.erb
@@ -170,11 +170,6 @@
-<%
- url = 'jquery.dataTables/en.json'
- url = "jquery.dataTables/#{I18n.locale.to_s.downcase}.json" if I18n.locale && !I18n.locale.to_s.match(/^en.*/)
-%>
-
diff --git a/app/views/dmsf_upload/_multi_upload.html.erb b/app/views/dmsf_upload/_multi_upload.html.erb
index addcafcb..20dc8dc3 100644
--- a/app/views/dmsf_upload/_multi_upload.html.erb
+++ b/app/views/dmsf_upload/_multi_upload.html.erb
@@ -71,7 +71,7 @@
<%= stylesheet_link_tag 'plupload/jquery.ui.plupload.css', :plugin => 'redmine_dmsf' %>
<%= javascript_include_tag 'plupload/js/plupload.full.min.js', :plugin => 'redmine_dmsf' %>
<%= javascript_include_tag 'plupload/js/jquery.ui.plupload/jquery.ui.plupload.js', :plugin => 'redmine_dmsf' %>
- <%= javascript_include_tag("plupload/js/i18n/#{I18n.locale.to_s.downcase}.js", :plugin => 'redmine_dmsf') if I18n.locale && !I18n.locale.to_s.match(/^en.*/) %>
+ <%= javascript_include_tag(js_url, :plugin => 'redmine_dmsf') %>