forked from fanruan/design
Browse Source
* commit '7f511cd6d2900d112f180d11639810552806b02e': (21 commits) 根据国际化规范,修改不合理地方。 . REPORT-10025 10.0 & 5.0版本依据国际化规范调整国际化内容 . . CORE-116 国际化拆分设计器、服务器和web 规范国际化文件及国际化定义。 无JIRA任务 打包 debug debug 无JIRA任务 代码质量 无JIRA任务 本来就是默认路径时起不来 无JIRA任务 本来就是默认路径时起不来 相应调整 REPORT-10025 10.0 & 5.0版本依据国际化规范调整国际化内容 REPORT-10419 部分准备工作,删除 重构调整 'CHART-2705' REPORT-10025 10.0 & 5.0版本依据国际化规范调整国际化内容 found and correct the bug ...master
ju
6 years ago
344 changed files with 1102 additions and 2164 deletions
File diff suppressed because one or more lines are too long
@ -1,48 +1,57 @@
|
||||
package com.fr.design.i18n; |
||||
|
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.general.log.MessageFormatter; |
||||
import com.fr.locale.InterProviderFactory; |
||||
import com.fr.locale.LocaleManager; |
||||
import com.fr.locale.impl.FineLocaleManager; |
||||
|
||||
/** |
||||
* 设计器国际化类,后面会不再依赖InterProviderFactory |
||||
*/ |
||||
public class Toolkit { |
||||
|
||||
private static LocaleManager localeManager = FineLocaleManager.create(); |
||||
|
||||
static { |
||||
addResource("com/fr/design/i18n/main"); |
||||
} |
||||
|
||||
public static void addResource(String path) { |
||||
|
||||
localeManager.addResource(path); |
||||
} |
||||
|
||||
/** |
||||
* 设计器国际化方法 |
||||
* |
||||
* @param key 国际化键 |
||||
* @return 国际化值 |
||||
*/ |
||||
public static String i18nText(String key) { |
||||
return InterProviderFactory.getProvider().getLocText(key); |
||||
return localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, key); |
||||
} |
||||
|
||||
/** |
||||
* 带格式化内容的国际化方法 |
||||
* Toolkit.i18nText("Fine-Design_xxx", 1, 2),假设Fine-Design_xxx的中文值为:我来计算{}+{},输出结果为:我来计算1+2 |
||||
* @param key 格式化文本 |
||||
* |
||||
* @param key 格式化文本 |
||||
* @param args 格式化参数 |
||||
* @return 国际化值 |
||||
*/ |
||||
public static String i18nText(String key, Object... args) { |
||||
String format = InterProviderFactory.getProvider().getLocText(key); |
||||
MessageFormatter.FormattingTuple tuple = MessageFormatter.arrayFormat(format, args); |
||||
return tuple.getMessage(); |
||||
return localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, tuple.getMessage()); |
||||
} |
||||
|
||||
/** |
||||
* 太鸡儿多了,改不完,先加上慢慢改 |
||||
* |
||||
* @deprecated |
||||
*/ |
||||
public static String i18nTextArray(String[] keys) { |
||||
return InterProviderFactory.getProvider().getLocText(keys); |
||||
} |
||||
|
||||
/** |
||||
* 太鸡儿多了,改不完,先加上慢慢改 |
||||
* @deprecated |
||||
*/ |
||||
public static String i18nTextArray(String[] keys, String[] delimiter) { |
||||
return InterProviderFactory.getProvider().getLocText(keys, delimiter); |
||||
} |
||||
} |
||||
|
@ -1 +1 @@
|
||||
package com.fr.design.javascript;
import com.fr.data.ClassSubmitJob;
import com.fr.design.write.submit.CustomSubmitJobPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.js.CustomActionJavaScript;
import java.awt.*;
/**
* Author : Shockway
* Date: 13-8-12
* Time: 下午7:47
*/
public class CustomActionPane extends FurtherBasicBeanPane<CustomActionJavaScript> {
CustomSubmitJobPane classPane = new CustomSubmitJobPane();
public CustomActionPane() {
this.setLayout(new BorderLayout());
this.add(classPane, BorderLayout.CENTER);
}
/**
* 判断界面是否为js 传入
* @param ob 对象是否为js
* @return 是否是js对象
*/
@Override
public boolean accept(Object ob) {
return ob instanceof CustomActionJavaScript;
}
/**
* 标题
* @return 标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Submit_Type_Custom");
}
/**
* 重置
*/
@Override
public void reset() {
this.classPane.reset();
}
@Override
public void populateBean(CustomActionJavaScript ob) {
classPane.populateBean(ob.getJob());
}
@Override
public CustomActionJavaScript updateBean() {
CustomActionJavaScript cs = new CustomActionJavaScript();
cs.setJob((ClassSubmitJob)classPane.updateBean());
return cs;
}
} |
||||
package com.fr.design.javascript;
import com.fr.data.ClassSubmitJob;
import com.fr.design.write.submit.CustomSubmitJobPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.js.CustomActionJavaScript;
import java.awt.*;
/**
* Author : Shockway
* Date: 13-8-12
* Time: 下午7:47
*/
public class CustomActionPane extends FurtherBasicBeanPane<CustomActionJavaScript> {
CustomSubmitJobPane classPane = new CustomSubmitJobPane();
public CustomActionPane() {
this.setLayout(new BorderLayout());
this.add(classPane, BorderLayout.CENTER);
}
/**
* 判断界面是否为js 传入
* @param ob 对象是否为js
* @return 是否是js对象
*/
@Override
public boolean accept(Object ob) {
return ob instanceof CustomActionJavaScript;
}
/**
* 标题
* @return 标题
*/
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom");
}
/**
* 重置
*/
@Override
public void reset() {
this.classPane.reset();
}
@Override
public void populateBean(CustomActionJavaScript ob) {
classPane.populateBean(ob.getJob());
}
@Override
public CustomActionJavaScript updateBean() {
CustomActionJavaScript cs = new CustomActionJavaScript();
cs.setJob((ClassSubmitJob)classPane.updateBean());
return cs;
}
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue