commit
c75805754a
14 changed files with 652 additions and 0 deletions
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<project basedir="." default="jar" name="plugin"> |
||||
<!-- JDK路径,根据自己机器上实际位置修改--> |
||||
<property name="jdk.home" value="D:/Java/jdk1.6.0_45"/> |
||||
|
||||
<property name="libs" value="${basedir}/lib"/> |
||||
<property name="publicLibs" value=""/> |
||||
<property name="reportLibs" value="${basedir}/../webroot/WEB-INF/lib"/> |
||||
<property name="destLoc" value="."/> |
||||
<property name="classes" value="classes"/> |
||||
<xmlproperty file="${basedir}/plugin.xml"/> |
||||
<property name="current-version" value="${plugin.version}"/> |
||||
|
||||
<!-- 插件版本--> |
||||
<property name="plugin-version" value="${current-version}"/> |
||||
<!-- 插件名字--> |
||||
<property name="plugin-name" value="user-language"/> |
||||
<property name="plugin-jar" value="fr-plugin-${plugin-name}-${plugin-version}.jar"/> |
||||
|
||||
<target name="prepare"> |
||||
<delete dir="${classes}"/> |
||||
<delete dir="fr-plugin-${plugin-name}-${plugin-version}"/> |
||||
<xmlproperty file="${basedir}/plugin.xml"/> |
||||
<delete dir="${destLoc}/${plugin.name}"/> |
||||
</target> |
||||
<path id="compile.classpath"> |
||||
<fileset dir="${libs}"> |
||||
<include name="**/*.jar"/> |
||||
</fileset> |
||||
<fileset dir="${publicLibs}"> |
||||
<include name="**/*.jar"/> |
||||
</fileset> |
||||
<fileset dir="${reportLibs}"> |
||||
<include name="**/*.jar"/> |
||||
</fileset> |
||||
</path> |
||||
<patternset id="resources4Jar"> |
||||
<exclude name="**/.settings/**"/> |
||||
<exclude name=".classpath"/> |
||||
<exclude name=".project"/> |
||||
|
||||
<exclude name="**/*.java"/> |
||||
<exclude name="**/*.db"/> |
||||
<exclude name="**/*.g"/> |
||||
<exclude name="**/package.html"/> |
||||
</patternset> |
||||
<target name="copy_resources"> |
||||
<echo message="从${resources_from}拷贝图片,JS,CSS等资源文件"/> |
||||
<delete dir="tmp"/> |
||||
<copy todir="tmp"> |
||||
<fileset dir="${resources_from}/src/main/resources"> |
||||
<patternset refid="resources4Jar"/> |
||||
</fileset> |
||||
</copy> |
||||
<copy todir="${classes}"> |
||||
<fileset dir="tmp"/> |
||||
</copy> |
||||
<delete dir="tmp"/> |
||||
</target> |
||||
<target name="compile_javas"> |
||||
<echo message="编译${compile_files}下的Java文件"/> |
||||
<javac destdir="${classes}" debug="false" optimize="on" source="${source_jdk_version}" |
||||
target="${target_jdk_version}" |
||||
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}" |
||||
executable="${compile_jdk_version}/bin/javac"> |
||||
<src path="${basedir}/src/main/java"/> |
||||
<exclude name="**/.svn/**"/> |
||||
<compilerarg line="-encoding UTF8 "/> |
||||
<classpath refid="compile.classpath"/> |
||||
</javac> |
||||
</target> |
||||
|
||||
<target name="jar_classes"> |
||||
<echo message="打Jar包:${jar_name}"/> |
||||
<delete file="${basedir}/${jar_name}"/> |
||||
<jar jarfile="${basedir}/${jar_name}"> |
||||
<fileset dir="${classes}"> |
||||
</fileset> |
||||
</jar> |
||||
</target> |
||||
|
||||
<target name="super_jar" depends="prepare"> |
||||
<antcall target="copy_resources"> |
||||
<param name="resources_from" value="${basedir}"/> |
||||
</antcall> |
||||
<antcall target="compile_javas"> |
||||
<param name="source_jdk_version" value="1.6"/> |
||||
<param name="target_jdk_version" value="1.6"/> |
||||
<param name="compile_jdk_version" value="${jdk.home}"/> |
||||
<param name="compile_files" value="${basedir}/src"/> |
||||
</antcall> |
||||
<echo message="compile plugin success!"/> |
||||
|
||||
<antcall target="jar_classes"> |
||||
<param name="jar_name" value="${plugin-jar}"/> |
||||
</antcall> |
||||
<delete dir="${classes}"/> |
||||
|
||||
</target> |
||||
|
||||
<target name="jar" depends="super_jar"> |
||||
<antcall target="zip"/> |
||||
</target> |
||||
|
||||
<target name="zip"> |
||||
<property name="plugin-folder" value="fr-plugin-${plugin-name}-${plugin-version}"/> |
||||
<echo message="----------zip files----------"/> |
||||
<mkdir dir="${plugin-folder}"/> |
||||
<copy todir="${plugin-folder}"> |
||||
<fileset dir="."> |
||||
<include name="${plugin-jar}"/> |
||||
<include name="plugin.xml"/> |
||||
</fileset> |
||||
<fileset dir="${libs}"> |
||||
<include name="*.jar"/> |
||||
<include name="*.dll"/> |
||||
</fileset> |
||||
</copy> |
||||
<zip destfile="${basedir}/${plugin-folder}.zip" basedir="."> |
||||
<include name="${plugin-folder}/*.jar"/> |
||||
<include name="${plugin-folder}/*.dll"/> |
||||
<include name="${plugin-folder}/plugin.xml"/> |
||||
</zip> |
||||
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/> |
||||
</target> |
||||
</project> |
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<plugin> |
||||
<id>com.fr.plugin.decision.user.language</id> |
||||
<name><![CDATA[个人语言偏好]]></name> |
||||
<active>yes</active> |
||||
<hidden>no</hidden> |
||||
<version>1.0</version> |
||||
<env-version>10.0~</env-version> |
||||
<jartime>2019-3-31</jartime> |
||||
<vendor>finereport.Elijah</vendor> |
||||
<description><![CDATA[个人用户语言偏好设置]]></description> |
||||
<change-notes><![CDATA[]]></change-notes> |
||||
<function-recorder class="com.fr.plugin.decision.user.language.action.AllLanguagesAction"/> |
||||
<extra-decision> |
||||
<HttpHandlerProvider class="com.fr.plugin.decision.user.language.UserLanguageHttpHandlerProvider"/> |
||||
<URLAliasProvider class="com.fr.plugin.decision.user.language.UserLanguageUrlAliasProvider"/> |
||||
<WebResource class = "com.fr.plugin.decision.user.language.UserLanguageWebResource"/> |
||||
</extra-decision> |
||||
</plugin> |
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
<parent> |
||||
<artifactId>starter</artifactId> |
||||
<groupId>com.fr.plugin</groupId> |
||||
<version>10.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>decision-user-language</artifactId> |
||||
|
||||
|
||||
</project> |
@ -0,0 +1,25 @@
|
||||
package com.fr.plugin.decision.user.language; |
||||
|
||||
import com.fr.decision.fun.HttpHandler; |
||||
import com.fr.decision.fun.impl.AbstractHttpHandlerProvider; |
||||
import com.fr.plugin.decision.user.language.action.AllLanguagesAction; |
||||
import com.fr.plugin.decision.user.language.action.GetUserLanguageAction; |
||||
import com.fr.plugin.decision.user.language.action.I18nAction; |
||||
import com.fr.plugin.decision.user.language.action.SetUserLanguageAction; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class UserLanguageHttpHandlerProvider extends AbstractHttpHandlerProvider { |
||||
@Override |
||||
public HttpHandler[] registerHandlers() { |
||||
return new HttpHandler[] { |
||||
new AllLanguagesAction(), |
||||
new GetUserLanguageAction(), |
||||
new SetUserLanguageAction(), |
||||
new I18nAction() |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,21 @@
|
||||
package com.fr.plugin.decision.user.language; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractURLAliasProvider; |
||||
import com.fr.decision.webservice.url.alias.URLAlias; |
||||
import com.fr.decision.webservice.url.alias.URLAliasFactory; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class UserLanguageUrlAliasProvider extends AbstractURLAliasProvider { |
||||
@Override |
||||
public URLAlias[] registerAlias() { |
||||
return new URLAlias[] { |
||||
URLAliasFactory.createPluginAlias("/languages", "/languages", false), |
||||
URLAliasFactory.createPluginAlias("/language", "/language", false), |
||||
URLAliasFactory.createPluginAlias("/i18n", "/i18n", true) |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.plugin.decision.user.language; |
||||
|
||||
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||
import com.fr.decision.web.MainComponent; |
||||
import com.fr.plugin.decision.user.language.web.UserLanguageComponent; |
||||
import com.fr.web.struct.Atom; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class UserLanguageWebResource extends AbstractWebResourceProvider { |
||||
@Override |
||||
public Atom attach() { |
||||
return MainComponent.KEY; |
||||
} |
||||
|
||||
@Override |
||||
public Atom client() { |
||||
return UserLanguageComponent.KEY; |
||||
} |
||||
} |
@ -0,0 +1,51 @@
|
||||
package com.fr.plugin.decision.user.language.action; |
||||
|
||||
import com.fr.decision.fun.impl.BaseHttpHandler; |
||||
import com.fr.decision.webservice.Response; |
||||
import com.fr.plugin.decision.user.language.bean.LanguageBean; |
||||
import com.fr.plugin.transform.FunctionRecorder; |
||||
import com.fr.third.fasterxml.jackson.databind.ObjectMapper; |
||||
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: 目前只有这几种语言课选择,后面可能加入自定义语言包插件的语言,故保留此接口 |
||||
*/ |
||||
@FunctionRecorder |
||||
public class AllLanguagesAction extends BaseHttpHandler { |
||||
|
||||
private static final List<LanguageBean> LANGUAGES = Arrays.asList( |
||||
new LanguageBean("简体中文", "zh_CN"), |
||||
new LanguageBean("繁體中文", "zh_TW"), |
||||
new LanguageBean("English", "en_US"), |
||||
new LanguageBean("한국어", "ko_KR"), |
||||
new LanguageBean("日本語", "ja_JP")); |
||||
|
||||
|
||||
@Override |
||||
public RequestMethod getMethod() { |
||||
return RequestMethod.GET; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return "/languages"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isPublic() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { |
||||
WebUtils.printAsString(response, new ObjectMapper().writeValueAsString(Response.ok(LANGUAGES))); |
||||
} |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.plugin.decision.user.language.action; |
||||
|
||||
import com.fr.decision.fun.impl.BaseHttpHandler; |
||||
import com.fr.decision.webservice.Response; |
||||
import com.fr.decision.webservice.v10.user.UserService; |
||||
import com.fr.third.fasterxml.jackson.databind.ObjectMapper; |
||||
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class GetUserLanguageAction extends BaseHttpHandler { |
||||
@Override |
||||
public RequestMethod getMethod() { |
||||
return RequestMethod.GET; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return "/language"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isPublic() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { |
||||
WebUtils.printAsString(response, new ObjectMapper().writeValueAsString(Response.ok(UserService.getInstance().getUserByRequest(request).getLanguage()))); |
||||
} |
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.plugin.decision.user.language.action; |
||||
|
||||
import com.fr.decision.fun.impl.BaseHttpHandler; |
||||
import com.fr.decision.web.i18n.I18nTextGenerator; |
||||
import com.fr.decision.webservice.Response; |
||||
import com.fr.decision.webservice.utils.WebServiceUtils; |
||||
import com.fr.locale.InterProviderFactory; |
||||
import com.fr.third.fasterxml.jackson.databind.ObjectMapper; |
||||
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: 由于<script>标签中的国际化会有浏览器缓存问题,故开此ajax接口覆盖默认国际化 |
||||
*/ |
||||
public class I18nAction extends BaseHttpHandler { |
||||
@Override |
||||
public RequestMethod getMethod() { |
||||
return RequestMethod.GET; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return "/i18n"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isPublic() { |
||||
return true; |
||||
} |
||||
|
||||
@Override |
||||
public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { |
||||
I18nTextGenerator generator = new I18nTextGenerator(); |
||||
WebUtils.printAsString(response, new ObjectMapper().writeValueAsString(Response.ok(InterProviderFactory.getClientProvider().getEntireKV(WebServiceUtils.getLocale(request))))); |
||||
} |
||||
} |
@ -0,0 +1,43 @@
|
||||
package com.fr.plugin.decision.user.language.action; |
||||
|
||||
import com.fr.decision.authority.AuthorityContext; |
||||
import com.fr.decision.authority.data.User; |
||||
import com.fr.decision.fun.impl.BaseHttpHandler; |
||||
import com.fr.decision.webservice.Response; |
||||
import com.fr.decision.webservice.v10.user.UserService; |
||||
import com.fr.third.fasterxml.jackson.databind.ObjectMapper; |
||||
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
||||
import com.fr.web.utils.WebUtils; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class SetUserLanguageAction extends BaseHttpHandler { |
||||
@Override |
||||
public RequestMethod getMethod() { |
||||
return RequestMethod.PUT; |
||||
} |
||||
|
||||
@Override |
||||
public String getPath() { |
||||
return "/language"; |
||||
} |
||||
|
||||
@Override |
||||
public boolean isPublic() { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void handle(HttpServletRequest request, HttpServletResponse response) throws Exception { |
||||
User user = UserService.getInstance().getUserByRequest(request); |
||||
user.setLanguage(WebUtils.getHTTPRequestParameter(request, "language")); |
||||
AuthorityContext.getInstance().getUserController().update(user); |
||||
WebUtils.printAsString(response, new ObjectMapper().writeValueAsString(Response.success())); |
||||
} |
||||
} |
@ -0,0 +1,37 @@
|
||||
package com.fr.plugin.decision.user.language.bean; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class LanguageBean { |
||||
|
||||
private String text; |
||||
|
||||
private String value; |
||||
|
||||
public String getText() { |
||||
return text; |
||||
} |
||||
|
||||
public void setText(String text) { |
||||
this.text = text; |
||||
} |
||||
|
||||
public String getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public void setValue(String value) { |
||||
this.value = value; |
||||
} |
||||
|
||||
public LanguageBean() { |
||||
} |
||||
|
||||
public LanguageBean(String text, String value) { |
||||
this.text = text; |
||||
this.value = value; |
||||
} |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.plugin.decision.user.language.web; |
||||
|
||||
import com.fr.web.struct.Component; |
||||
import com.fr.web.struct.browser.RequestClient; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
import com.fr.web.struct.category.StylePath; |
||||
|
||||
/** |
||||
* @Author: Elijah |
||||
* @Create: 2019-04-30 |
||||
* @Desciption: |
||||
*/ |
||||
public class UserLanguageComponent extends Component { |
||||
|
||||
public static final UserLanguageComponent KEY = new UserLanguageComponent(); |
||||
|
||||
@Override |
||||
public ScriptPath script(RequestClient requestClient) { |
||||
return ScriptPath.build("com/fr/plugin/decision/user/language/language.js"); |
||||
} |
||||
|
||||
@Override |
||||
public StylePath style(RequestClient requestClient) { |
||||
return StylePath.build("com/fr/plugin/decision/user/language/language.css"); |
||||
} |
||||
} |
@ -0,0 +1,187 @@
|
||||
!(function () { |
||||
var I18n = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "" |
||||
}, |
||||
|
||||
_store: function () { |
||||
return BI.Models.getModel("dec.model.user.setting.language"); |
||||
}, |
||||
|
||||
watch: { |
||||
showText: function (v) { |
||||
this.showLanguage.setText(v); |
||||
|
||||
} |
||||
}, |
||||
|
||||
beforeInit: function (callback) { |
||||
this.store.initPage(callback); |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
return { |
||||
type: "bi.combo", |
||||
ref: function (_ref) { |
||||
self.combo = _ref; |
||||
}, |
||||
trigger: "click-hover", |
||||
direction: "bottom,left", |
||||
adjustXOffset: 0, |
||||
el: { |
||||
type: "bi.vertical_adapt", |
||||
cls: "cursor-pointer", |
||||
items: [{ |
||||
el: { |
||||
type: "bi.label", |
||||
text: this.model.showText, |
||||
ref: function (_ref) { |
||||
self.showLanguage = _ref; |
||||
} |
||||
} |
||||
}, { |
||||
el: { |
||||
type: "bi.icon_change_button", |
||||
ref: function (_ref) { |
||||
self.arrowButton = _ref; |
||||
}, |
||||
cls: "account-arrow-trigger", |
||||
iconCls: "account-down-arrow-font" |
||||
} |
||||
}], |
||||
height: 40, |
||||
hgap: 5 |
||||
}, |
||||
popup: { |
||||
el: { |
||||
type: "bi.text_value_combo_popup", |
||||
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, |
||||
items: this.model.items, |
||||
value: this.model.language, |
||||
listeners: [{ |
||||
eventName: BI.TextValueComboPopup.EVENT_CHANGE, |
||||
action: function (v) { |
||||
self.store.setLanguage(v); |
||||
self.combo.hideView(); |
||||
} |
||||
}] |
||||
}, |
||||
innerVGap: 5, |
||||
minWidth: 125 |
||||
}, |
||||
listeners: [{ |
||||
eventName: "EVENT_AFTER_POPUPVIEW", |
||||
action: function () { |
||||
self.arrowButton.setIcon("account-up-arrow-font"); |
||||
} |
||||
}, { |
||||
eventName: "EVENT_AFTER_HIDEVIEW", |
||||
action: function () { |
||||
self.arrowButton.setIcon("account-down-arrow-font"); |
||||
} |
||||
}] |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("dec.user.setting.language", I18n); |
||||
})(); |
||||
|
||||
!(function () { |
||||
var Model = BI.inherit(Fix.Model, { |
||||
|
||||
state: function () { |
||||
return { |
||||
items: [{ |
||||
text: "简体中文", |
||||
value: "zh_CN" |
||||
}], |
||||
language: "zh_CN" |
||||
}; |
||||
}, |
||||
|
||||
computed: { |
||||
textItems: function () { |
||||
var items = []; |
||||
BI.each(this.model.items, function (i, v) { |
||||
return items[v.value] = v.text; |
||||
}); |
||||
return items; |
||||
}, |
||||
|
||||
showText: function () { |
||||
return this.model.textItems[this.model.language]; |
||||
} |
||||
}, |
||||
|
||||
actions: { |
||||
initPage: function (callback) { |
||||
var self = this, flag = 0; |
||||
Dec.Utils.getSupportLanguages(function (res) { |
||||
res.data && (self.model.items = res.data); |
||||
if (++flag === 2) { |
||||
callback(); |
||||
} |
||||
}); |
||||
Dec.Utils.getCurrLanguages(function (res) { |
||||
res.data && (self.model.language = res.data); |
||||
if (++flag === 2) { |
||||
callback(); |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
setLanguage: function (v) { |
||||
var self = this; |
||||
Dec.Utils.setCurrLanguages(v, function () { |
||||
self.model.language = v; |
||||
window.location.reload(true); |
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
BI.model("dec.model.user.setting.language", Model); |
||||
})(); |
||||
|
||||
!(function () { |
||||
Dec.Utils = Dec.Utils || {}; |
||||
|
||||
|
||||
|
||||
BI.extend(Dec.Utils, { |
||||
getSupportLanguages: function (callback) { |
||||
Dec.reqGet("/url/languages", {}, callback); |
||||
}, |
||||
|
||||
getCurrLanguages: function (callback) { |
||||
Dec.reqGet("/url/language", {}, callback); |
||||
}, |
||||
|
||||
setCurrLanguages: function (v, callback) { |
||||
Dec.reqPut("/url/language?" + Dec.Utils.transformObject2URLParam({language: v}, null, true), {}, callback); |
||||
}, |
||||
|
||||
reloadi18n: function (cb) { |
||||
Dec.reqGet("/url/i18n", {}, function (res) { |
||||
BI.i18n = BI.i18n || {}; |
||||
BI.extend(BI.i18n, res.data); |
||||
BI.addI18n(res.data); |
||||
cb(); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
/*Dec.init.addPrepares(function (cb) { |
||||
Dec.Utils.reloadi18n(cb); |
||||
});*/ |
||||
})(); |
||||
|
||||
!(function () { |
||||
BI.config("dec.constant.header.items", function (items) { |
||||
items.push({ |
||||
type: "dec.user.setting.language" |
||||
}); |
||||
return items; |
||||
}); |
||||
})(); |
Loading…
Reference in new issue