require 'json' class AnnouncementLinkWidgetsController < ApplicationController def widget data = { "tags" => [], "extras" => { "heading-announcements" => t("announcement_link_widget.bulletins"), "heading-links" => t("announcement_link_widget.related_links") } } f = File.join(Rails.root, "public" , "announcement_link_widget_#{I18n.locale.to_s}.json") if File.exist?(f) contents = File.read(f) data = JSON.parse(contents) end data end end