Class Translation
java.lang.Object
io.rocketbase.commons.translation.Translation
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd translation to list - overwrite existingbuilder()booleanlookup with locale of LocaleContextHoldergetTranslated(Locale locale) lookup for locale in following order: lookup for exact locale (de-DE-bayrisch) afterwards for only parts of the locale-tag (de-DE, de) afterwards fpr (en) then for (ROOT "") when only one translation exists return itinthashCode()booleanexactly search within map if locale containsbooleanhasLocaleLooselyFilter(Locale locale) uses theLocaleFilterfunction to search if locale could be foundstatic Translationinit TranslationtoString()static Translationtranslation(String translation) init Translation with value for Locale of LocaleContextHolder
-
Constructor Details
-
Translation
public Translation()
-
-
Method Details
-
of
init Translation- Parameters:
locale- Locale of valuevalue- text- Returns:
- new Translation instant
-
translation
init Translation with value for Locale of LocaleContextHolder- Parameters:
translation- value- Returns:
- new Translation instant
-
builder
-
add
add translation to list - overwrite existing -
english
-
french
-
german
-
italian
-
japanese
-
korean
-
chinese
-
root
-
getLocales
-
getTranslated
lookup for locale in following order:- lookup for exact locale (de-DE-bayrisch)
- afterwards for only parts of the locale-tag (de-DE, de)
- afterwards fpr (en)
- then for (ROOT "")
- when only one translation exists return it
- Parameters:
locale- exact match locale- Returns:
- translated value when found
-
getTranslated
lookup with locale of LocaleContextHolder- Returns:
- translated value when found
-
hasLocale
exactly search within map if locale contains -
hasLocaleLooselyFilter
uses theLocaleFilterfunction to search if locale could be found -
equals
-
hashCode
public int hashCode() -
toString
-