]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openweathermap] Internationalization of discovery results (#11484)
authorlolodomo <lg.hc@free.fr>
Mon, 1 Nov 2021 14:12:23 +0000 (15:12 +0100)
committerGitHub <noreply@github.com>
Mon, 1 Nov 2021 14:12:23 +0000 (15:12 +0100)
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/discovery/OpenWeatherMapDiscoveryService.java
bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap.properties
bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_de.properties
bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_fr.properties

index 408978e3b7aa086ec6970b5d6b0a611f68e282a8..905f966814095debfd5dfc76fd58231b5f5c9468 100644 (file)
@@ -136,26 +136,26 @@ public class OpenWeatherMapDiscoveryService extends AbstractDiscoveryService {
 
     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());
     }
 }
index 1b17db9b56609b3ae49d8f94565ac92d1ef4d42e..cccfcbf4715c85b6d3bdbedbb620f4425a11cd86 100644 (file)
@@ -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)
index 78b315aa30593911f8752591de968a04da9ffd58..7002b89633fba83052d489fa94a6873a08f7a128 100644 (file)
@@ -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
index 1ebe61246a8d5e6d1299dea0b70f65524228645d..9e8c25a277e9d9a85380e5a21b078d4de3e8ab1b 100644 (file)
@@ -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