fix #2299 add fe:message
This commit is contained in:
parent
c830e7b189
commit
aa2b552634
2 changed files with 13 additions and 0 deletions
|
@ -399,4 +399,9 @@ public class FessFunctions {
|
|||
}
|
||||
return "<pre class=\"" + style + " linenums:" + lineNum + "\">" + content + "</pre>";
|
||||
}
|
||||
|
||||
public static String getMessage(final String key, final String defaultValue) {
|
||||
final Locale locale = LaRequestUtil.getOptionalRequest().map(HttpServletRequest::getLocale).orElse(Locale.ROOT);
|
||||
return ComponentUtil.getMessageManager().findMessage(locale, key).orElse(defaultValue);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -257,4 +257,12 @@
|
|||
<function-signature>java.lang.String formatCode(java.lang.String, java.lang.String, java.lang.String, java.lang.String)</function-signature>
|
||||
<example>${fe:formatCode("L", "prettyprint", doc.mimetype, doc.content_description)}</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>Get a message from properties files.</description>
|
||||
<name>message</name>
|
||||
<function-class>org.codelibs.fess.taglib.FessFunctions</function-class>
|
||||
<function-signature>java.lang.String getMessage(java.lang.String, java.lang.String)</function-signature>
|
||||
<example>${fe:message("labels.foobar", "default value")}</example>
|
||||
</function>
|
||||
</taglib>
|
||||
|
|
Loading…
Add table
Reference in a new issue