From 0944cd877734a697680a49c29b5428a59c8c5e8d Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Wed, 11 Mar 2020 18:56:39 +0800 Subject: [PATCH] Fix translation missing in file(en).Fix download_file are not visable in index page problem. --- app/controllers/announcements_controller.rb | 1 + config/locales/en.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index e81c146..e429be1 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -11,6 +11,7 @@ class AnnouncementsController < ApplicationController "status-class" => "status-#{status['classname']}" } end + locale = OrbitHelper.get_site_locale.to_s files = a.bulletin_files.map{|file| { "file_url" => file.file.url, "file_title" => (file.title.blank? ? File.basename(file.file.path) : file.title rescue '') } if file.enabled_for?(locale) } rescue [] files.delete(nil) links = a.bulletin_links.map{|link| { "link_url" => link.url, "link_title" => (link.title.blank? ? link.url : link.title) } } rescue [] diff --git a/config/locales/en.yml b/config/locales/en.yml index 87f0310..757d271 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -28,7 +28,7 @@ en: category: Category author: Author link: Link - File: File + file: File view_count: View Count add_new: Add New export_to_excel: Export to Excel