Update translations and templates.

This commit is contained in:
BoHung Chiu 2021-07-27 17:12:37 +08:00
parent 621fbbb420
commit 9c2e126aa8
4 changed files with 18 additions and 9 deletions

View File

@ -1,10 +1,11 @@
class RulingWeathersController < ApplicationController class RulingWeathersController < ApplicationController
def widget def widget
@ruling_weather_setting = RulingWeatherSetting.find(OrbitHelper.widget_custom_value) @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" => {}, "extras" => {}.merge(head_trans),
"weather" => [@ruling_weather_setting.get_now_info] "weather" => [@ruling_weather_setting.get_now_info]
} }
end end
def get_weather_info def get_weather_info
@ruling_weather_setting = RulingWeatherSetting.find(params[:id]) @ruling_weather_setting = RulingWeatherSetting.find(params[:id])

View File

@ -14,3 +14,7 @@ en:
setting_management: Setting Management setting_management: Setting Management
weather_information_center_api_instruction: Weather Information Center API Instruction weather_information_center_api_instruction: Weather Information Center API Instruction
observatory_name: Observatory Name observatory_name: Observatory Name
uv: UV
relative_humidity: Relative humidity
current_wind_speed: Current wind speed
accumulated_rainfall: Accumulated rainfall

View File

@ -14,3 +14,7 @@ zh_tw:
setting_management: 設定管理 setting_management: 設定管理
weather_information_center_api_instruction: 中央氣象局API說明 weather_information_center_api_instruction: 中央氣象局API說明
observatory_name: "觀測站站名(蒐集雨量用)" observatory_name: "觀測站站名(蒐集雨量用)"
uv: 紫外線
relative_humidity: 相對溼度
current_wind_speed: 現在風速
accumulated_rainfall: 累積雨量

View File

@ -30,21 +30,21 @@
<div class="Tempature white_text" data-name="avgt">{{avgt}}<span>℃</span></div> <div class="Tempature white_text" data-name="avgt">{{avgt}}<span>℃</span></div>
</div> </div>
<div class="col-sm-4 columns"> <div class="col-sm-4 columns">
<div class="UviItem">紫外線</div> <div class="UviItem">{{uv-head}}</div>
<div class="UviText white_text" data-name="uvi_text">{{uvi_text}}</div> <div class="UviText white_text" data-name="uvi_text">{{uvi_text}}</div>
</div> </div>
</div> </div>
<div class="col-sm-12 columns weatherBlock"> <div class="col-sm-12 columns weatherBlock">
<div class="col-sm-4 columns"> <div class="col-sm-4 columns">
<div class="weatherItem">相對濕度</div> <div class="weatherItem">{{relative_humidity-head}}</div>
<div class="weatherItemNum white_text"><span data-name="rh">{{rh}}</span>%</div> <div class="weatherItemNum white_text"><span data-name="rh">{{rh}}</span>%</div>
</div> </div>
<div class="col-sm-4 columns"> <div class="col-sm-4 columns">
<div class="weatherItem">現在風速</div> <div class="weatherItem">{{current_wind_speed-head}}</div>
<div class="weatherItemNum white_text"><span data-name="ws">{{ws}}</span>m/s</div> <div class="weatherItemNum white_text"><span data-name="ws">{{ws}}</span>m/s</div>
</div> </div>
<div class="col-sm-4 columns"> <div class="col-sm-4 columns">
<div class="weatherItem">累積雨量</div> <div class="weatherItem">{{accumulated_rainfall-head}}</div>
<div class="weatherItemNum white_text"><span data-name="rain">{{rain}}</span>mm</div> <div class="weatherItemNum white_text"><span data-name="rain">{{rain}}</span>mm</div>
</div> </div>
</div> </div>