-
public interface NlsTemplateThis interface represents the template for an internationalized text that can betranslatedto a givenLocale.- See Also:
NlsMessage,NlsTemplateImpl
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringtranslate(Locale locale)This method translates the represented string for the givenlocale.booleantranslate(Locale locale, NlsArguments arguments, Appendable buffer)This method behaves liketranslate(Locale)but additionally fills the givenargumentsinto 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 givenargumentsinto the translated message writing into the givenbuffer.- Parameters:
locale- is the locale to translate to.arguments- are the dynamicNlsArgumentsto fill into the message.buffer- is the buffer where the translation will be appended to.- Returns:
trueif the (translated) message has been appended to the givenmessageBufferorfalseif the translation failed.
-
-