- All Implemented Interfaces:
- TemplateFunction, com.google.common.base.Function<String,String>
public class TranslateBundleFunction
extends Object
implements TemplateFunction
Mustache.java translation function based on localized ResourceBundles.
Usage code with a class:
public class ... {
TemplateFunction trans = new TranslateBundleFunction("com.project.locale", Locale.US);
...
}
Usage code with a Map:
HashMap scopes = new HashMap();
scopes.put("trans", new TranslateBundleFunction("com.project.locale", Locale.US));
...
Usage in template:
... {{#trans}}TranslatedLabel1{{/trans}} ...
- Author:
- gw0 [http://gw.tnode.com/]