如何在Liferay 7中添加新语言? [英] How can I add a new language in Liferay 7?

查看:60
本文介绍了如何在Liferay 7中添加新语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是如何在liferay 7中添加新语言,例如泰国语言. 当我检查现有标志时,我看到图像不是png而是svg,但是我无法添加带有图标的新语言. 在此page.jsp中,我看到图像的构造函数是自动生成的.

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.

此代码描述了svg图片的生成

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>

推荐答案

假定您已按照

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

  1. 创建一个新主题,或将现有主题修改为:

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

  • 将标记文件以SVG格式添加为images\lexicon\flags-xx-YY.svg(其中xx-YY是您的语言环境,区分大小写)
  • 在同一文件夹中打开文件icons.svg,并将标志SVG元素作为symbol添加到其他符号元素中: </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">

  • 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. 部署或重新部署主题,然后将其选择为所需页面的活动主题.

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

如果需要,清除浏览器缓存.

Clear the browser cache if needed.

这篇关于如何在Liferay 7中添加新语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆