You can access LanguageUtils by calling static methods from your Java class.
The following example shows the static use of the getMessage methods to retrieve messages (with token substitution in the third line).
LanguageUtils.getMessage(request, "reset"); LanguageUtils.getMessage(request, "num-records"); LanguageUtils.getMessage(request, "search-for", new String[]{ "American" });
A number of convenience method signatures are provided, allowing the user to specify the portlet request and message ID, and optionally to include parameters for token substitution and a default string. The default string may be useful for shared localized messages, allowing portlets to function with a default (un-localized) message if the localized message is not retrieved from the resource bundle.
All method signatures require specifying the PortletRequest.