From 6c648c4a4a5d3d6cfef1b0170312e2167192f637 Mon Sep 17 00:00:00 2001 From: Christoph Weitkamp Date: Wed, 6 Jan 2021 22:22:52 +0100 Subject: [PATCH] [openweathermap] Added more supported languages (#9717) Signed-off-by: Christoph Weitkamp --- .../config/OpenWeatherMapAPIConfiguration.java | 10 ++++------ .../src/main/resources/OH-INF/config/config.xml | 17 +++++++++++++++-- .../OH-INF/i18n/openweathermap_de.properties | 15 ++++++++++++++- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java index c63bab8cc..e28406bb0 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java +++ b/bundles/org.openhab.binding.openweathermap/src/main/java/org/openhab/binding/openweathermap/internal/config/OpenWeatherMapAPIConfiguration.java @@ -12,10 +12,7 @@ */ package org.openhab.binding.openweathermap.internal.config; -import java.util.Collections; import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -30,9 +27,10 @@ import org.openhab.binding.openweathermap.internal.handler.OpenWeatherMapAPIHand @NonNullByDefault public class OpenWeatherMapAPIConfiguration { // supported languages (see https://openweathermap.org/current#multi) - public static final Set SUPPORTED_LANGUAGES = Collections.unmodifiableSet(Stream.of("ar", "bg", "ca", "cz", - "de", "el", "en", "es", "fa", "fi", "fr", "gl", "hr", "hu", "it", "ja", "kr", "la", "lt", "mk", "nl", "pl", - "pt", "ro", "ru", "se", "sk", "sl", "tr", "ua", "vi", "zh_cn", "zh_tw").collect(Collectors.toSet())); + public static final Set SUPPORTED_LANGUAGES = Set.of("af", "al", "ar", "az", "bg", "ca", "cz", "da", "de", + "el", "en", "es", "sp", "eu", "fa", "fi", "fr", "gl", "he", "hi", "hr", "hu", "id", "it", "ja", "kr", "la", + "lt", "mk", "nl", "no", "pl", "pt", "pt_br", "ro", "ru", "se", "sv", "sk", "sl", "sr", "th", "tr", "uk", + "ua", "vi", "zh_cn", "zh_tw", "zu"); public @Nullable String apikey; public int refreshInterval; diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml index 011d64441..5bdcaeb40 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/config/config.xml @@ -20,13 +20,18 @@ Language to be used by the OpenWeatherMap API. + + + + + @@ -34,25 +39,33 @@ + + + + + + - + + - + + diff --git a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_de.properties b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_de.properties index acbf43114..524d7457c 100644 --- a/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_de.properties +++ b/bundles/org.openhab.binding.openweathermap/src/main/resources/OH-INF/i18n/openweathermap_de.properties @@ -15,20 +15,28 @@ bridge-type.config.openweathermap.weather-api.refreshInterval.description = Inte bridge-type.config.openweathermap.weather-api.language.label = Sprache bridge-type.config.openweathermap.weather-api.language.description = Sprache zur Anzeige der Daten. +bridge-type.config.openweathermap.weather-api.language.option.af = Afrikanisch +bridge-type.config.openweathermap.weather-api.language.option.al = Albanisch bridge-type.config.openweathermap.weather-api.language.option.ar = Arabisch +bridge-type.config.openweathermap.weather-api.language.option.az = Aserbaidschanisch bridge-type.config.openweathermap.weather-api.language.option.bg = Bulgarisch bridge-type.config.openweathermap.weather-api.language.option.ca = Katalanisch bridge-type.config.openweathermap.weather-api.language.option.cz = Tschechisch +bridge-type.config.openweathermap.weather-api.language.option.da = Dänisch bridge-type.config.openweathermap.weather-api.language.option.de = Deutsch bridge-type.config.openweathermap.weather-api.language.option.el = Griechisch bridge-type.config.openweathermap.weather-api.language.option.en = Englisch bridge-type.config.openweathermap.weather-api.language.option.es = Spanisch +bridge-type.config.openweathermap.weather-api.language.option.eu = Baskisch bridge-type.config.openweathermap.weather-api.language.option.fa = Persisch (Farsi) bridge-type.config.openweathermap.weather-api.language.option.fi = Finnisch bridge-type.config.openweathermap.weather-api.language.option.fr = Französisch bridge-type.config.openweathermap.weather-api.language.option.gl = Galizisch +bridge-type.config.openweathermap.weather-api.language.option.he = Hebräisch +bridge-type.config.openweathermap.weather-api.language.option.hi = Hindi bridge-type.config.openweathermap.weather-api.language.option.hr = Kroatisch bridge-type.config.openweathermap.weather-api.language.option.hu = Ungarisch +bridge-type.config.openweathermap.weather-api.language.option.id = Indonesisch bridge-type.config.openweathermap.weather-api.language.option.it = Italienisch bridge-type.config.openweathermap.weather-api.language.option.ja = Japanisch bridge-type.config.openweathermap.weather-api.language.option.kr = Koreanisch @@ -36,18 +44,23 @@ bridge-type.config.openweathermap.weather-api.language.option.la = Lettisch bridge-type.config.openweathermap.weather-api.language.option.lt = Litauisch bridge-type.config.openweathermap.weather-api.language.option.mk = Mazedonisch bridge-type.config.openweathermap.weather-api.language.option.nl = Holländisch +bridge-type.config.openweathermap.weather-api.language.option.no = Norwegisch bridge-type.config.openweathermap.weather-api.language.option.pl = Polnisch bridge-type.config.openweathermap.weather-api.language.option.pt = Portugiesisch +bridge-type.config.openweathermap.weather-api.language.option.pt_br = Português Brasilien bridge-type.config.openweathermap.weather-api.language.option.ro = Rumänisch bridge-type.config.openweathermap.weather-api.language.option.ru = Russisch bridge-type.config.openweathermap.weather-api.language.option.se = Schwedisch bridge-type.config.openweathermap.weather-api.language.option.sk = Slowakisch bridge-type.config.openweathermap.weather-api.language.option.sl = Slowenisch +bridge-type.config.openweathermap.weather-api.language.option.sr = Serbisch +bridge-type.config.openweathermap.weather-api.language.option.th = Thailändisch bridge-type.config.openweathermap.weather-api.language.option.tr = Türkisch -bridge-type.config.openweathermap.weather-api.language.option.ua = Ukrainisch +bridge-type.config.openweathermap.weather-api.language.option.uk = Ukrainisch bridge-type.config.openweathermap.weather-api.language.option.vi = Vietnamesisch bridge-type.config.openweathermap.weather-api.language.option.zh_cn = Chinesisch - Simplified bridge-type.config.openweathermap.weather-api.language.option.zh_tw = Chinesisch - Traditional +bridge-type.config.openweathermap.weather-api.language.option.zu = Zulu # thing types thing-type.openweathermap.weather-and-forecast.label = Wetterinformationen