How to add language icons in liferay DXP

南笙酒味 提交于 2019-12-01 05:41:47

问题


How to add the Language icon image in liferay 7(liferay-ce-portal-7.0-ga4).

I have followed the steps mentioned in following article,

https://web.liferay.com/web/salman.khan/blog/-/blogs/add-a-new-language-to-liferay-detailed-step-by-step- After the language configuration I can be able to see the languages but not the flags on web content forms.

So I created the custom theme to add the language file and added th_TH.png file in theme\src\images\language\th_TH.png. But din't work.

Then I tried the implementing the lexicon-icon approach mention in, how can i add a new language in liferay 7?

Still I am not able to see the language images.

Please refer the screenshot for details, Theme-layout and file location


回答1:


To add a custom icon that is not supported yet you need to add 2 artefacts into the theme. Liferay using 2 things for displaying icons. Somewhere it uses png flag and somewhere svg you need to adjust both.

Have a look at this sample project. https://github.com/mir333/custom-flag-admin-theme

It takes the admin theme of Liferay (it is a copy so it needs to be kept in sync with updates) and adds a new flag to the admin theme. The magic is in adding the flag into the lexicon. Under the hood, it takes the added flag svg files and recompiles the icons.svg files to include it.




回答2:


To anyone who still have issue showing the flag, I just want to point out that this helped me: https://stackoverflow.com/a/45907250

As described, open the icons.svg and add your flag's svg code in as a symbol with the id "xx-yy" (your language and country code, in lowercase).

The flag does not magically generate just from putting the flags-xx-YY.svg file into lexicon folder, not for me at least.



来源:https://stackoverflow.com/questions/46337507/how-to-add-language-icons-in-liferay-dxp

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