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
7.2 Freemarker ADT with localisation option
Hello All,
I'm working in version 7.2, trying to create an ADT to show Journal Articles, and need to include a localization option. Overall, we want most of the features of the full content display, but rehashed to fit our design structure. Using the language portlet for localization would not work for our company, as the article may have different languages to those supported by the site. Also, the localization option on the AP full content display shows a translated version of the article without changing the users locale and translating all of the menu options (really handy if you want to see the Korean translation without having to deal with Korean menu options :-). The standard AP Full Content template is done through a JSP, and the localization is created through a liferay-ui:language tag. Sadly, this taglib does not look like it has been mapped to a Freemarker macro - see here. How can I replicate the functionality in Freemarker. Alternatively, is there a way that I can write a JSP template?
Any ideas would be much appreciated.
--Rob
I'm working in version 7.2, trying to create an ADT to show Journal Articles, and need to include a localization option. Overall, we want most of the features of the full content display, but rehashed to fit our design structure. Using the language portlet for localization would not work for our company, as the article may have different languages to those supported by the site. Also, the localization option on the AP full content display shows a translated version of the article without changing the users locale and translating all of the menu options (really handy if you want to see the Korean translation without having to deal with Korean menu options :-). The standard AP Full Content template is done through a JSP, and the localization is created through a liferay-ui:language tag. Sadly, this taglib does not look like it has been mapped to a Freemarker macro - see here. How can I replicate the functionality in Freemarker. Alternatively, is there a way that I can write a JSP template?
Any ideas would be much appreciated.
--Rob
https://docs.liferay.com/portal/7.0/javadocs/portal-kernel/com/liferay/portal/kernel/language/LanguageUtil.html
${languageUtil.get(locale, "your-language-text-key")}
Of course, you need to create a resource bundle with the language keys in the various translations, but it should work.
${languageUtil.get(locale, "your-language-text-key")}
Of course, you need to create a resource bundle with the language keys in the various translations, but it should work.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™