Package org.nuclos.api.context
Interface TranslationContext
- All Superinterfaces:
LogContext
TranslationContext
represents the context used in a
Translator.translate(TranslationContext)
translate(TranslationContext)}.
All information that is available for translation.
-
Method Summary
Modifier and TypeMethodDescriptionGets the localization key for this translation.Gets the source locale of the text.Gets the target locale for translation.getText()
Gets the text to be translated.default boolean
isCached()
Determines if this translation should be cached.boolean
Determines if this is an in-memory translation that should not be persisted.boolean
Determines if this is a persistent translation that should be stored.Methods inherited from interface org.nuclos.api.context.LogContext
log, logError, logWarn
-
Method Details
-
getTargetLocale
Gets the target locale for translation.- Returns:
- The target locale
-
getSourceLocale
Locale getSourceLocale()Gets the source locale of the text.- Returns:
- The source locale, or null if no specific source locale is defined
-
getText
Gets the text to be translated.- Returns:
- The text to translate
-
getLocalizationKey
String getLocalizationKey()Gets the localization key for this translation.- Returns:
- The localization key, or null if no specific key is defined
-
isInMemoryTranslation
boolean isInMemoryTranslation()Determines if this is an in-memory translation that should not be persisted.- Returns:
- true if this is an in-memory translation, false otherwise
-
isPersistentTranslation
boolean isPersistentTranslation()Determines if this is a persistent translation that should be stored.- Returns:
- true if this is a persistent translation, false otherwise
-
isCached
default boolean isCached()Determines if this translation should be cached. A translation is cached if it is either an in-memory or a persistent translation.- Returns:
- true if this translation should be cached, false otherwise
-