当前位置:网站首页>Ueeditor internationalization configuration, supporting Chinese and English switching

Ueeditor internationalization configuration, supporting Chinese and English switching

2022-07-06 10:17:00 CHQIUU

UEditor At present, it supports Chinese and English . Which language needs to be used to directly load the response js that will do
As shown in the figure below

 load  lang/en/en.js  Show English after 
 load  lang/zh-cn/zh-cn.js  Chinese is displayed after 

 Insert picture description here
Here is JSP and FreeMarker There are two ways to realize automatic switching of page internationalization .

FreeMarker Page configuration

 <#if language=='EN'>
    <script type="text/javascript" charset="utf-8" src="${contextPath}/static/ueditor/lang/en/en.js"></script>
<#else>
    <script type="text/javascript" charset="utf-8" src="${contextPath}/static/ueditor/lang/zh-cn/zh-cn.js"></script>
</#if>

JSP Page configuration

<%if ("EN".equals(language)){
     %>
	<script type="text/javascript" charset="utf-8" src="<%=contextPath%>/static/ueditor/lang/en/en.js"></script>
<%} else {
     %>
	<script type="text/javascript" charset="utf-8" src="<%=contextPath%>/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<%} %>

The following is the renderings :
 Insert picture description here

原网站

版权声明
本文为[CHQIUU]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060910555341.html