Skip to content

Commit

Permalink
[openweathermap] Internationalization of discovery results (openhab#1…
Browse files Browse the repository at this point in the history
…1484)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
  • Loading branch information
lolodomo authored and dschoepel committed Nov 9, 2021
1 parent 15b168a commit ff4b1fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,26 @@ private void createResults(PointType location) {

private void createWeatherAndForecastResult(String location, ThingUID bridgeUID) {
thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_WEATHER_AND_FORECAST, bridgeUID, LOCAL))
.withLabel("Local Weather and Forecast").withProperty(CONFIG_LOCATION, location)
.withLabel("@text/discovery.weather-and-forecast.local.label").withProperty(CONFIG_LOCATION, location)
.withRepresentationProperty(CONFIG_LOCATION).withBridge(bridgeUID).build());
}

private void createAirPollutionResult(String location, ThingUID bridgeUID) {
thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_AIR_POLLUTION, bridgeUID, LOCAL))
.withLabel("Local Air Pollution").withProperty(CONFIG_LOCATION, location)
.withLabel("@text/discovery.air-pollution.local.label").withProperty(CONFIG_LOCATION, location)
.withRepresentationProperty(CONFIG_LOCATION).withBridge(bridgeUID).build());
}

private void createOneCallResult(String location, ThingUID bridgeUID) {
thingDiscovered(
DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_ONECALL_WEATHER_AND_FORECAST, bridgeUID, LOCAL))
.withLabel("One Call API Weather and Forecast").withProperty(CONFIG_LOCATION, location)
.withLabel("@text/discovery.onecall.local.label").withProperty(CONFIG_LOCATION, location)
.withRepresentationProperty(CONFIG_LOCATION).withBridge(bridgeUID).build());
}

private void createOneCallHistoryResult(String location, ThingUID bridgeUID) {
thingDiscovered(DiscoveryResultBuilder.create(new ThingUID(THING_TYPE_ONECALL_HISTORY, bridgeUID, LOCAL))
.withLabel("One Call API History Data").withProperty(CONFIG_LOCATION, location)
.withLabel("@text/discovery.onecall-history.local.label").withProperty(CONFIG_LOCATION, location)
.withRepresentationProperty(CONFIG_LOCATION).withBridge(bridgeUID).build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,7 @@ offline.conf-error-not-supported-onecall-number-of-alerts = The 'numberOfAlerts'

# discovery result

discovery.openweathermap.weather-and-forecast.api.local.label = Local Weather And Forecast
discovery.openweathermap.air-pollution.api.local.label = Local Air Pollution
discovery.weather-and-forecast.local.label = Local Weather and Forecast
discovery.air-pollution.local.label = Local Air Pollution
discovery.onecall.local.label = Local Weather and Forecast (One Call API)
discovery.onecall-history.local.label = Local History Data (One Call API)
Original file line number Diff line number Diff line change
Expand Up @@ -424,5 +424,5 @@ offline.conf-error-not-supported-onecall-number-of-days = Der Parameter 'forecas
offline.conf-error-not-supported-onecall-number-of-alerts = Der Parameter 'numberOfAlerts' muss größer oder gleich 0 sein.

# discovery result
discovery.openweathermap.weather-and-forecast.api.local.label = Lokales Wetter und Wettervorhersage
discovery.openweathermap.air-pollution.api.local.label = Lokale Luftqualität
discovery.weather-and-forecast.local.label = Lokales Wetter und Wettervorhersage
discovery.air-pollution.local.label = Lokale Luftqualität
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,5 @@ offline.conf-error-not-supported-onecall-number-of-hours = Le paramètre 'foreca
offline.conf-error-not-supported-onecall-number-of-days = Le paramètre 'forecastDays' doit être compris entre 0 et 7.

# discovery result
discovery.openweathermap.weather-and-forecast.api.local.label = Météo locale et prévisions
discovery.openweathermap.uvindex.api.local.label = Indice UV local
discovery.weather-and-forecast.local.label = Météo locale et prévisions
discovery.air-pollution.local.label = Indice UV local

0 comments on commit ff4b1fb

Please sign in to comment.