留言板
Change the language of Liferay from a Struts Action ?
Yousri B,修改在13 年前。
Change the language of Liferay from a Struts Action ?
Junior Member 帖子: 70 加入日期: 08-4-11 最近的帖子
I am developing a struts portlet in Liferay SDK 6
How can I change the language of Liferay from a Struts Action ?
Thank you
How can I change the language of Liferay from a Struts Action ?
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
Thank you
Peter Shin,修改在13 年前。
RE: Change the language of Liferay from a Struts Action ?
Regular Member 帖子: 121 加入日期: 07-9-24 最近的帖子
I think this will change the language. May need to tweak things a lil bit to fit your use case.
String languageId = ParamUtil.getString(request, "languageId", "es_ES");
Locale locale = LocaleUtil.fromLanguageId(languageId);
String redirect = PortalUtil.getLayoutFriendlyURL(themeDisplay.getLayout(), themeDisplay, locale);
response.sendRedirect(redirect);
return null;
Yousri B,修改在13 年前。
RE: Change the language of Liferay from a Struts Action ?
Junior Member 帖子: 70 加入日期: 08-4-11 最近的帖子
I add this code but not change language
String redirect = PortalUtil.getLayoutFriendlyURL(themeDisplay.getLayout(), themeDisplay, locale);
// redirect is "/ar/web/guest/test" -> good
response.sendRedirect(PortalUtil.getLayoutFriendlyURL(themeDisplay.getLayout(), themeDisplay, locale));
return mapping.findForward("test.view");
Don Kim,修改在13 年前。
RE: Change the language of Liferay from a Struts Action ?
New Member 发布: 1 加入日期: 10-9-23 最近的帖子
I'm also trying to do similar stuff as customization of the LR language portlet.
The following is my requirement.
1. Add 'All' as saving 'Null' value into LR table.
2. I have to customize by including other fields and submitting as one form.
I was able to create a language hook as adding submit button instead of triggering select changing event from select option but I think I have to create a new language portlet by extracting from LR language source code for my requirement. Can you please give me the direction and specially which action class has to be updated for #1.
Thanks,
Don
The following is my requirement.
1. Add 'All' as saving 'Null' value into LR table.
2. I have to customize by including other fields and submitting as one form.
I was able to create a language hook as adding submit button instead of triggering select changing event from select option but I think I have to create a new language portlet by extracting from LR language source code for my requirement. Can you please give me the direction and specially which action class has to be updated for #1.
Thanks,
Don