[smhi] Prepare for easier translation (#13305)

Signed-off-by: Anders Alfredsson <andersb86@gmail.com>
This commit is contained in:
Anders Alfredsson 2022-08-22 10:47:44 +02:00 committed by GitHub
parent ed3642da84
commit 29fb142e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 111 additions and 144 deletions

View File

@ -19,9 +19,9 @@ The forecast thing needs to be configured with the latitude and longitude for th
You can also choose for which hours and which days you would like to get forecasts. You can also choose for which hours and which days you would like to get forecasts.
| Parameter | Description | Required | | Parameter | Description | Required |
|-----------|-------------|----------| |------------------|---------------------------------|----------|
| Latitude | Latitude of the forecast | Yes | | Latitude | Latitude of the forecast | Yes |
| Longitute | Longitude of the forecast | Yes | | Longitude | Longitude of the forecast | Yes |
| Hourly forecasts | The hourly forecasts to display | No | | Hourly forecasts | The hourly forecasts to display | No |
| Daily forecasts | The daily forecasts to display | No | | Daily forecasts | The daily forecasts to display | No |
@ -41,7 +41,7 @@ Examples:
#### Basic channels #### Basic channels
| channel | type | channel id | description | | channel | type | channel id | description |
|----------|--------|------------|------------------------------| |-------------------------|----------------------|------------|---------------------------------------------------------------------------|
| Temperature | Number:Temperature | t | Temperature in Celsius | | Temperature | Number:Temperature | t | Temperature in Celsius |
| Max Temperature | Number:Temperature | tmax | Highest temperature of the day (daily forecast only) | | Max Temperature | Number:Temperature | tmax | Highest temperature of the day (daily forecast only) |
| Min Temperature | Number:Temperature | tmin | Lowest temperature of the day (daily forecast only) | | Min Temperature | Number:Temperature | tmin | Lowest temperature of the day (daily forecast only) |
@ -62,7 +62,7 @@ Examples:
#### Advanced channels #### Advanced channels
| channel | type | channel id | description | | channel | type | channel id | description |
|----------|--------|------------|------------------------------| |--------------------------|----------------------|------------|--------------------------------------------------------------------------------------------|
| Visibility | Number:Length | vis | Horizontal visibility in km | | Visibility | Number:Length | vis | Horizontal visibility in km |
| Thunder probability | Number:Dimensionless | tstm | Probability of thunder in percent | | Thunder probability | Number:Dimensionless | tstm | Probability of thunder in percent |
| Frozen precipitation | Number:Dimensionless | spp | Percent of precipitation in frozen form (will be set to UNDEF if there's no precipitation) | | Frozen precipitation | Number:Dimensionless | spp | Percent of precipitation in frozen form (will be set to UNDEF if there's no precipitation) |
@ -72,10 +72,10 @@ Examples:
| Mean precipitation | Number:Speed | pmean | Mean precipitation intensity in mm/h | | Mean precipitation | Number:Speed | pmean | Mean precipitation intensity in mm/h |
| Median precipitation | Number:Speed | pmedian | Median precipitation intensity in mm/h | | Median precipitation | Number:Speed | pmedian | Median precipitation intensity in mm/h |
\* The precipitation category can have a value from 0-6, representing different types of precipitaion: \* The precipitation category can have a value from 0-6, representing different types of precipitation:
| Value | Meaning | | Value | Meaning |
|-------|---------| |-------|------------------|
| 0 | No precipitation | | 0 | No precipitation |
| 1 | Snow | | 1 | Snow |
| 2 | Snow and rain | | 2 | Snow and rain |
@ -87,7 +87,7 @@ Examples:
\** The weather condition channel can take values from 1-27, each corresponding to a different weather condition: \** The weather condition channel can take values from 1-27, each corresponding to a different weather condition:
| Value | Condition | | Value | Condition |
|-------|-----------| |-------|------------------------|
| 1 | Clear sky | | 1 | Clear sky |
| 2 | Nearly clear sky | | 2 | Nearly clear sky |
| 3 | Variable cloudiness | | 3 | Variable cloudiness |

View File

@ -317,7 +317,7 @@ public class SmhiHandler extends BaseThingHandler {
return; return;
} catch (PointOutOfBoundsException e) { } catch (PointOutOfBoundsException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Coordinates outside valid area"); "@text/thing-status.invalidCoordinates");
cancelPolling(); cancelPolling();
return; return;
} }

View File

@ -19,31 +19,31 @@
<description>The hourly forecasts to display</description> <description>The hourly forecasts to display</description>
<limitToOptions>true</limitToOptions> <limitToOptions>true</limitToOptions>
<options> <options>
<option value="0">Current hour</option> <option value="0">@text/thing-type.smhi.forecast.group.hour_0.label</option>
<option value="1">Next hour</option> <option value="1">@text/thing-type.smhi.forecast.group.hour_1.label</option>
<option value="2">2 hours from now</option> <option value="2">@text/thing-type.smhi.forecast.group.hour_2.label</option>
<option value="3">3 hours from now</option> <option value="3">@text/thing-type.smhi.forecast.group.hour_3.label</option>
<option value="4">4 hours from now</option> <option value="4">@text/thing-type.smhi.forecast.group.hour_4.label</option>
<option value="5">5 hours from now</option> <option value="5">@text/thing-type.smhi.forecast.group.hour_5.label</option>
<option value="6">6 hours from now</option> <option value="6">@text/thing-type.smhi.forecast.group.hour_6.label</option>
<option value="7">7 hours from now</option> <option value="7">@text/thing-type.smhi.forecast.group.hour_7.label</option>
<option value="8">8 hours from now</option> <option value="8">@text/thing-type.smhi.forecast.group.hour_8.label</option>
<option value="9">9 hours from now</option> <option value="9">@text/thing-type.smhi.forecast.group.hour_9.label</option>
<option value="10">10 hours from now</option> <option value="10">@text/thing-type.smhi.forecast.group.hour_10.label</option>
<option value="11">11 hours from now</option> <option value="11">@text/thing-type.smhi.forecast.group.hour_11.label</option>
<option value="12">12 hours from now</option> <option value="12">@text/thing-type.smhi.forecast.group.hour_12.label</option>
<option value="13">13 hours from now</option> <option value="13">@text/thing-type.smhi.forecast.group.hour_13.label</option>
<option value="14">14 hours from now</option> <option value="14">@text/thing-type.smhi.forecast.group.hour_14.label</option>
<option value="15">15 hours from now</option> <option value="15">@text/thing-type.smhi.forecast.group.hour_15.label</option>
<option value="16">16 hours from now</option> <option value="16">@text/thing-type.smhi.forecast.group.hour_16.label</option>
<option value="17">17 hours from now</option> <option value="17">@text/thing-type.smhi.forecast.group.hour_17.label</option>
<option value="18">18 hours from now</option> <option value="18">@text/thing-type.smhi.forecast.group.hour_18.label</option>
<option value="19">19 hours from now</option> <option value="19">@text/thing-type.smhi.forecast.group.hour_19.label</option>
<option value="20">20 hours from now</option> <option value="20">@text/thing-type.smhi.forecast.group.hour_20.label</option>
<option value="21">21 hours from now</option> <option value="21">@text/thing-type.smhi.forecast.group.hour_21.label</option>
<option value="22">22 hours from now</option> <option value="22">@text/thing-type.smhi.forecast.group.hour_22.label</option>
<option value="23">23 hours from now</option> <option value="23">@text/thing-type.smhi.forecast.group.hour_23.label</option>
<option value="24">24 hours from now</option> <option value="24">@text/thing-type.smhi.forecast.group.hour_24.label</option>
</options> </options>
</parameter> </parameter>
<parameter name="dailyForecasts" type="integer" multiple="true"> <parameter name="dailyForecasts" type="integer" multiple="true">
@ -51,16 +51,16 @@
<description>The daily forecasts to display</description> <description>The daily forecasts to display</description>
<limitToOptions>true</limitToOptions> <limitToOptions>true</limitToOptions>
<options> <options>
<option value="0">Today</option> <option value="0">@text/thing-type.smhi.forecast.group.day_0.label</option>
<option value="1">Tomorrow</option> <option value="1">@text/thing-type.smhi.forecast.group.day_1.label</option>
<option value="2">2 days from now</option> <option value="2">@text/thing-type.smhi.forecast.group.day_2.label</option>
<option value="3">3 days from now</option> <option value="3">@text/thing-type.smhi.forecast.group.day_3.label</option>
<option value="4">4 days from now</option> <option value="4">@text/thing-type.smhi.forecast.group.day_4.label</option>
<option value="5">5 days from now</option> <option value="5">@text/thing-type.smhi.forecast.group.day_5.label</option>
<option value="6">6 days from now</option> <option value="6">@text/thing-type.smhi.forecast.group.day_6.label</option>
<option value="7">7 days from now</option> <option value="7">@text/thing-type.smhi.forecast.group.day_7.label</option>
<option value="8">8 days from now</option> <option value="8">@text/thing-type.smhi.forecast.group.day_8.label</option>
<option value="9">9 days from now</option> <option value="9">@text/thing-type.smhi.forecast.group.day_9.label</option>
</options> </options>
</parameter> </parameter>
</config-description> </config-description>

View File

@ -82,43 +82,8 @@ thing-type.smhi.forecast.group.hour_9.description = Forecast for 9 hours from no
thing-type.config.smhi.forecast.dailyForecasts.label = Daily Forecasts thing-type.config.smhi.forecast.dailyForecasts.label = Daily Forecasts
thing-type.config.smhi.forecast.dailyForecasts.description = The daily forecasts to display thing-type.config.smhi.forecast.dailyForecasts.description = The daily forecasts to display
thing-type.config.smhi.forecast.dailyForecasts.option.0 = Today
thing-type.config.smhi.forecast.dailyForecasts.option.1 = Tomorrow
thing-type.config.smhi.forecast.dailyForecasts.option.2 = 2 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.3 = 3 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.4 = 4 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.5 = 5 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.6 = 6 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.7 = 7 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.8 = 8 days from now
thing-type.config.smhi.forecast.dailyForecasts.option.9 = 9 days from now
thing-type.config.smhi.forecast.hourlyForecasts.label = Hourly Forecasts thing-type.config.smhi.forecast.hourlyForecasts.label = Hourly Forecasts
thing-type.config.smhi.forecast.hourlyForecasts.description = The hourly forecasts to display thing-type.config.smhi.forecast.hourlyForecasts.description = The hourly forecasts to display
thing-type.config.smhi.forecast.hourlyForecasts.option.0 = Current hour
thing-type.config.smhi.forecast.hourlyForecasts.option.1 = Next hour
thing-type.config.smhi.forecast.hourlyForecasts.option.2 = 2 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.3 = 3 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.4 = 4 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.5 = 5 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.6 = 6 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.7 = 7 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.8 = 8 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.9 = 9 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.10 = 10 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.11 = 11 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.12 = 12 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.13 = 13 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.14 = 14 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.15 = 15 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.16 = 16 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.17 = 17 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.18 = 18 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.19 = 19 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.20 = 20 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.21 = 21 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.22 = 22 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.23 = 23 hours from now
thing-type.config.smhi.forecast.hourlyForecasts.option.24 = 24 hours from now
thing-type.config.smhi.forecast.latitude.label = Latitude thing-type.config.smhi.forecast.latitude.label = Latitude
thing-type.config.smhi.forecast.latitude.description = Latitude for the forecast thing-type.config.smhi.forecast.latitude.description = Latitude for the forecast
thing-type.config.smhi.forecast.longitude.label = Longitude thing-type.config.smhi.forecast.longitude.label = Longitude
@ -215,3 +180,5 @@ channel-type.smhi.wsymb2.state.option.24 = Heavy sleet
channel-type.smhi.wsymb2.state.option.25 = Light snowfall channel-type.smhi.wsymb2.state.option.25 = Light snowfall
channel-type.smhi.wsymb2.state.option.26 = Moderate snowfall channel-type.smhi.wsymb2.state.option.26 = Moderate snowfall
channel-type.smhi.wsymb2.state.option.27 = Heavy snowfall channel-type.smhi.wsymb2.state.option.27 = Heavy snowfall
thing-status.invalidCoordinates = Coordinates outside valid area