Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: how to use Internationalization in serviceImpl(service builder)
hi
i'd like to know, is there passable to use LanguageUtil in serviceImpl class?
my request is send mail to some use and trigger by method of thread and serviceImpl class.
i know how to use in portlet or jsp
LanguageUtil.get(request, <key>, <default value>)
but in my BaseMessageListener or other thead, i do have request(ActoinRequest or RenderRequest)
how can i use LanguageUtil? or is there anyother way to use internationalization?
thank you in advance
in current, i use liferay ce 7.4.3.4
i put constent folder onder src/main/java, and use
ResourceBundle rb = ResourceBundle.getBundle("constent.Language", currentLocale);
System.out.println(rb.getString(<my key>));
LanguageUtil also has methods that take a Locale instead of a request
hi Olaf
thank you.
but my question is, i cannot get the properties when it in src/main/resource.
in portlet, i can config in annotation @Component, but in other independent object, i don't know how to do.
Hi,
You can refer different module Language resources by adding "-liferay-aggregate-resource-bundles:module name to refer resourcebundle" in your bnd file. Please refer below:
Powered by Liferay™