Skip to content

dvbern/commons-i18n-l10n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commons-i18n-l10n

Helper methods to facilitate i18n and l10n concerns

Usage

assertions

enum TestAppLanguages implements AppLanguage {
    DE(ULocale.forLanguageTag("de-CH")),
    FR(ULocale.forLanguageTag("fr-CH"));
	// code omitted for brevity
}

// business code
public I18nMessage sayHello(String toWho) {
    return I18nMessage.of("hello.world", "world", toWho);
}

// test code
@Test
public void has_all_translations_for_hello_world() {
    assertThatI18nMessage(sayHello("World"))
            .usingTLFactory(tlFactory)
            .translatesTo(TestAppLanguages.DE, "Hallo World")
            .translatesTo(TestAppLanguages.FR, "Bonjour World")
            .hasAllLanguagesTranslated(TestAppLanguages.values());
}

About

Helper methods to facilitate i18n and l10n concerns

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages