Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package freemarker.template;
An abstract base class for scalars that vary by locale. Here is a silly usage example. TemplateScalarModel localizedYes = new LocalizedString() { public String getLocalizedString(java.util.Locale locale) { String lang = locale.getLanguage(); if "fr".equals(lang) return "oui"; else if "de".equals(lang) return "s�"; else return "yes"; } };

Jonathan Revusky
abstract public class LocalizedString implements TemplateScalarModel {
		Environment env = Environment.getCurrentEnvironment();
		Locale locale = env.getLocale();
		return getLocalizedString(locale);
	abstract public String getLocalizedString(Locale localethrows TemplateModelException;
New to GrepCode? Check out our FAQ X