提交 60fccc8b authored 作者: xuxueli's avatar xuxueli

后端代码国际化定制

上级 0346ddbb
...@@ -24,9 +24,11 @@ public class I18nUtil { ...@@ -24,9 +24,11 @@ public class I18nUtil {
private static Logger logger = LoggerFactory.getLogger(I18nUtil.class); private static Logger logger = LoggerFactory.getLogger(I18nUtil.class);
private static Properties prop = null; private static Properties prop = null;
private static long lastCacheTim = 0L;
public static Properties loadI18nProp(){ public static Properties loadI18nProp(){
if (prop != null) { if (prop != null && (System.currentTimeMillis()-lastCacheTim)<3*1000) {
//return prop; return prop;
} }
try { try {
// bild i18n prop // bild i18n prop
...@@ -38,9 +40,11 @@ public class I18nUtil { ...@@ -38,9 +40,11 @@ public class I18nUtil {
Resource resource = new ClassPathResource(i18nFile); Resource resource = new ClassPathResource(i18nFile);
EncodedResource encodedResource = new EncodedResource(resource,"UTF-8"); EncodedResource encodedResource = new EncodedResource(resource,"UTF-8");
prop = PropertiesLoaderUtils.loadProperties(encodedResource); prop = PropertiesLoaderUtils.loadProperties(encodedResource);
lastCacheTim = System.currentTimeMillis();
} catch (IOException e) { } catch (IOException e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
} }
logger.warn("---111---");
return prop; return prop;
} }
......
...@@ -108,7 +108,7 @@ jobinfo_field_jobgroup=执行器 ...@@ -108,7 +108,7 @@ jobinfo_field_jobgroup=执行器
jobinfo_field_jobdesc=任务描述 jobinfo_field_jobdesc=任务描述
jobinfo_field_gluetype=运行模式 jobinfo_field_gluetype=运行模式
jobinfo_field_executorparam=任务参数 jobinfo_field_executorparam=任务参数
jobinfo_field_cron_unvalid=请输入格式正确的Cron jobinfo_field_cron_unvalid=Cron格式非法
jobinfo_field_author=负责人 jobinfo_field_author=负责人
jobinfo_field_alarmemail=报警邮件 jobinfo_field_alarmemail=报警邮件
jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔 jobinfo_field_alarmemail_placeholder=请输入报警邮件,多个邮件地址则逗号分隔
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论