diff --git a/app/controllers/ruling_weathers_controller.rb b/app/controllers/ruling_weathers_controller.rb index 16fa548..af46a67 100644 --- a/app/controllers/ruling_weathers_controller.rb +++ b/app/controllers/ruling_weathers_controller.rb @@ -1,10 +1,11 @@ class RulingWeathersController < ApplicationController def widget @ruling_weather_setting = RulingWeatherSetting.find(OrbitHelper.widget_custom_value) + head_trans = ["uv","relative_humidity","current_wind_speed","accumulated_rainfall"].map{|head| ["#{head}-head",I18n.t("ruling_weather.#{head}")]}.to_h { - "extras" => {}, - "weather" => [@ruling_weather_setting.get_now_info] - } + "extras" => {}.merge(head_trans), + "weather" => [@ruling_weather_setting.get_now_info] + } end def get_weather_info @ruling_weather_setting = RulingWeatherSetting.find(params[:id]) diff --git a/config/locales/en.yml b/config/locales/en.yml index 78ea2b4..2ffe6b0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -13,4 +13,8 @@ en: location_need_match_dataid: "Location must match dataid." setting_management: Setting Management weather_information_center_api_instruction: Weather Information Center API Instruction - observatory_name: Observatory Name \ No newline at end of file + observatory_name: Observatory Name + uv: UV + relative_humidity: Relative humidity + current_wind_speed: Current wind speed + accumulated_rainfall: Accumulated rainfall \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 11175ee..b5d7947 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -13,4 +13,8 @@ zh_tw: location_need_match_dataid: "地點須與資料集代碼相符合(Ex: 資料集代碼選擇宜蘭縣,則地點只能選擇宜蘭縣的鄉鎮)" setting_management: 設定管理 weather_information_center_api_instruction: 中央氣象局API說明 - observatory_name: "觀測站站名(蒐集雨量用)" \ No newline at end of file + observatory_name: "觀測站站名(蒐集雨量用)" + uv: 紫外線 + relative_humidity: 相對溼度 + current_wind_speed: 現在風速 + accumulated_rainfall: 累積雨量 \ No newline at end of file diff --git a/modules/ruling_weather/_ruling_weather_widget1.html.erb b/modules/ruling_weather/_ruling_weather_widget1.html.erb index 80d9e49..c63e878 100644 --- a/modules/ruling_weather/_ruling_weather_widget1.html.erb +++ b/modules/ruling_weather/_ruling_weather_widget1.html.erb @@ -30,21 +30,21 @@