Issue #265: Created LabelService to support UI localization

This commit is contained in:
Mario Zupan
2016-11-23 13:55:58 +01:00
parent 4940a12d0d
commit 6acd149e5f
4 changed files with 125 additions and 6 deletions

View File

@ -17,4 +17,18 @@ public class LabelProviderTest {
"Congratulations. You have successfully completed this lesson."));
}
@Test
public void shouldFallBackToEnglishIfLanguageNotSupported() {
LabelProvider labelProvider = new LabelProvider();
assertThat(labelProvider.get(Locale.CHINESE, "LessonCompleted"), CoreMatchers.equalTo(
"Congratulations. You have successfully completed this lesson."));
}
@Test
public void shouldUseProvidedLanguageIfSupported() {
LabelProvider labelProvider = new LabelProvider();
assertThat(labelProvider.get(Locale.GERMAN, "RestartLesson"), CoreMatchers.equalTo(
"Lektion neu beginnen"));
}
}