How can I add a new language in Liferay 7?

老子叫甜甜 提交于 2019-12-20 02:43:09

问题


My problem is how to add new language like thailand language in liferay 7. When I inspect the existing flag I see that the image is not png but it is svg, but I can't add new language with icon. In this page.jsp I see that the constructor of image is automatically generated.

This code describes the generation of svg image

<svg class="lexicon-icon lexicon-icon-<%= image %>" role="img" title="<%= HtmlUtil.escapeAttribute(LanguageUtil.get(resourceBundle, label)) %>" <%= InlineUtil.buildDynamicAttributes(dynamicAttributes) %>>
    <use xlink:href="<%= Validator.isNotNull(src) ? src : themeDisplay.getPathThemeImages() + "/lexicon/icons.svg" %>#<%= image %>" />
</svg>

回答1:


Assuming that you have followed all the steps in this Liferay blog, adding the flag in Liferay 7 requires:

  1. Create a new theme, or modify existing theme to :

    • add your flag file in SVG format as images\lexicon\flags-xx-YY.svg (where xx-YY is your locale, case-sensitive)
    • open the file icons.svg in the same folder and add your flag SVG elements as a symbol among the other symbol elements: </symbol><symbol id="xx-yy" viewBox="0 0 512 512"> <rect y="64" fill="#B0BEC9" width="512" height="384"/> <rect x="16" y="80" width="480" height="352" fill="#fff"/> <rect ..... /> <circle .... /> </symbol><symbol id="zh-cn" viewBox="0 0 512 512">

      1. Deploy, or re-deploy, the theme and choose it as the active theme for the pages you want.

      2. Clear the browser cache if needed.



来源:https://stackoverflow.com/questions/39394800/how-can-i-add-a-new-language-in-liferay-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!