diff --git a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/i18n/TranslationProviderOSGiTest.java b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/i18n/TranslationProviderOSGiTest.java index 814ef15e6..34cafff65 100644 --- a/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/i18n/TranslationProviderOSGiTest.java +++ b/itests/org.openhab.core.tests/src/main/java/org/openhab/core/internal/i18n/TranslationProviderOSGiTest.java @@ -52,7 +52,8 @@ public class TranslationProviderOSGiTest extends JavaOSGiTest { private static final String HELLO_MULTIPLE_NAMES_EN = "Hello openHAB, Hello thing, Hello rule!"; private static final String HELLO_MULTIPLE_NAMES_FR = "Bonjour openHAB, Bonjour thing, Bonjour rule!"; - private static final String BYE_DEFAULT = "Tschuess!"; + private static final String BYE_DE = "Tschüß!"; + private static final String BYE_EN = "Bye!"; TranslationProvider translationProvider; @@ -110,9 +111,13 @@ public class TranslationProviderOSGiTest extends JavaOSGiTest { assertThat(text, is(notNullValue())); assertThat(text, is(equalTo("default"))); + text = translationProvider.getText(bundle, KEY_BYE, "default", new Locale("de", "AT")); + assertThat(text, is(notNullValue())); + assertThat(text, is(equalTo(BYE_DE))); + text = translationProvider.getText(bundle, KEY_BYE, "default", Locale.ENGLISH); assertThat(text, is(notNullValue())); - assertThat(text, is(equalTo(BYE_DEFAULT))); + assertThat(text, is(equalTo(BYE_EN))); } @Test @@ -149,9 +154,13 @@ public class TranslationProviderOSGiTest extends JavaOSGiTest { assertThat(text, is(notNullValue())); assertThat(text, is(equalTo("default"))); + text = translationProvider.getText(bundle, KEY_BYE, "default", new Locale("de", "AT"), (Object[]) null); + assertThat(text, is(notNullValue())); + assertThat(text, is(equalTo(BYE_DE))); + text = translationProvider.getText(bundle, KEY_BYE, "default", Locale.ENGLISH, (Object[]) null); assertThat(text, is(notNullValue())); - assertThat(text, is(equalTo(BYE_DEFAULT))); + assertThat(text, is(equalTo(BYE_EN))); } @Test diff --git a/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_de_AT.properties b/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_de_AT.properties new file mode 100644 index 000000000..4d9c9bb0c --- /dev/null +++ b/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_de_AT.properties @@ -0,0 +1 @@ +BYE = Tschüß! diff --git a/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_en.properties b/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_en.properties index 89e40164e..5657b4341 100644 --- a/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_en.properties +++ b/itests/org.openhab.core.tests/src/main/resources/OH-INF/i18n/otherResourceName_en.properties @@ -1 +1 @@ -BYE = Tschuess! +BYE = Bye!