7.2 Freemarker ADT with localisation option

Rob Hazel, modified 6 Years ago. New Member Posts: 16 Join Date: 5/9/12 Recent Posts
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
thumbnail
Christoph Rabel, modified 6 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
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.