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
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])

View File

@ -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
observatory_name: Observatory Name
uv: UV
relative_humidity: Relative humidity
current_wind_speed: Current wind speed
accumulated_rainfall: Accumulated rainfall

View File

@ -13,4 +13,8 @@ zh_tw:
location_need_match_dataid: "地點須與資料集代碼相符合(Ex: 資料集代碼選擇宜蘭縣,則地點只能選擇宜蘭縣的鄉鎮)"
setting_management: 設定管理
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>
<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>
</div>
<div class="col-sm-12 columns weatherBlock">
<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>
<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>
<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>
</div>