-
public interface NlsTemplate
This interface represents the template for an internationalized text that can betranslated
to a givenLocale
.- See Also:
NlsMessage
,NlsTemplateImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
translate(Locale locale)
This method translates the represented string for the givenlocale
.boolean
translate(Locale locale, NlsArguments arguments, Appendable buffer)
This method behaves liketranslate(Locale)
but additionally fills the givenarguments
into the translated message writing into the givenbuffer
.
-
-
-
Method Detail
-
translate
String translate(Locale locale)
This method translates the represented string for the givenlocale
.
This typically happens via a lookup in aResourceBundle
).- Parameters:
locale
- is the locale to translate to.- Returns:
- the resolved string (closest translation for the given
locale
).
-
translate
boolean translate(Locale locale, NlsArguments arguments, Appendable buffer)
This method behaves liketranslate(Locale)
but additionally fills the givenarguments
into the translated message writing into the givenbuffer
.- Parameters:
locale
- is the locale to translate to.arguments
- are the dynamicNlsArguments
to fill into the message.buffer
- is the buffer where the translation will be appended to.- Returns:
true
if the (translated) message has been appended to the givenmessageBuffer
orfalse
if the translation failed.
-
-