From documentation special variable .locale
retrieves a String representation of the locale.
But how can the Locale
be retrieved within freemarker markup?
If there is no built-in function I must pass the Locale
to the template and pass it to each macro.
Simplified example:
Java Bean.class
public Locale getLocale();
public String getFoo(Locale locale);
Freemarker
Cannot use string locale!
<#setting locale="${bean.getLocale()}">
${bean.getFoo(.locale)}