From 580dc88c8453f3152d58a1f3465f6009183a5539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 16 Sep 2019 13:54:32 +0200 Subject: [PATCH] Bug with 'sr-Yu.json not found' #1037 --- app/helpers/dmsf_helper.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/helpers/dmsf_helper.rb b/app/helpers/dmsf_helper.rb index e1f6c1fd..a9ce0b1e 100644 --- a/app/helpers/dmsf_helper.rb +++ b/app/helpers/dmsf_helper.rb @@ -80,16 +80,22 @@ module DmsfHelper locale = I18n.locale || 'en' ret = File.join('jquery.dataTables', 'locales', "#{locale}.json") path = File.join('public', plugin_asset_path(:redmine_dmsf, 'javascripts', ret)) - return ret if File.exist?(path) - Rails.logger.warn "#{path} not found" + unless File.exist?(path) + Rails.logger.warn "#{path} not found" + ret = File.join('jquery.dataTables', 'locales', 'en.json') + end + ret end def js_url locale = I18n.locale || 'en' ret = File.join('plupload', 'js', 'i18n', "#{locale}.js") path = File.join('public', plugin_asset_path(:redmine_dmsf, 'javascripts', ret)) - return ret if File.exist?(path) - Rails.logger.warn "#{path} not found" + unless File.exist?(path) + Rails.logger.warn "#{path} not found" + ret = File.join('plupload', 'js', 'i18n', 'en.js') + end + ret end def self.visible_folders(folders, project)