forked from fanruan/design
Browse Source
* commit 'afd396c75169c4ce622e3828aad2173f17f29865': (22 commits) update KERNEL-582 国际化定制的地方会越来越多,想办法去掉这种if else写法 && REPORT-18522 将所有海外版设计器的信息回传功能阉割 将所有海外版设计器的信息回传功能阉割 处理乱码和入库重复问题 没有用户名时用uuid作为用户名 update REPORT-17908 启动动画“初始化”的国际化问题 REPORT-17887 数字控件最大值最小值部分场景保存失败 REPORT-17277 frm的body点击事件不见了 && REPORT-17897 设计器文件-选项显示不完整 && REPORT-17873 模板-报表填报属性-刷新按钮提示框的国际化问题 CHART-9401 fix list fix list CHART-3647 删除多余代码 update REPORT-17656 决策报表报表块复制后值被清空 MOBILE-21196 【性能】移动端》报表》打开少数单元格插入图片的模板,出现加载缓慢,时间在5s以上不等 设计器部分 update KERNEL-582 国际化定制的地方会越来越多,想办法去掉这种if else写法 REPORT-17494 模板版本管理,选项灰化问题 REPORT-17730 控件名无法保存 REPORT-15183 有一个改远程url的接口补一下10.0 ...research/10.0
neil
6 years ago
27 changed files with 344 additions and 187 deletions
@ -0,0 +1,31 @@
|
||||
package com.fr.design.locale.impl; |
||||
|
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.general.locale.LocaleMark; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Locale; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Hades |
||||
* @date 2019/6/24 |
||||
*/ |
||||
public class ProductImproveMark implements LocaleMark<Boolean> { |
||||
|
||||
private Map<Locale, Boolean> map = new HashMap<>(); |
||||
|
||||
public ProductImproveMark() { |
||||
map.put(Locale.CHINA, true); |
||||
map.put(Locale.TAIWAN, false); |
||||
map.put(Locale.US, false); |
||||
map.put(Locale.KOREA, false); |
||||
map.put(Locale.JAPAN, false); |
||||
} |
||||
|
||||
@Override |
||||
public Boolean getValue() { |
||||
Boolean result = map.get(GeneralContext.getLocale()); |
||||
return result == null ? false : result; |
||||
} |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.fr.design.locale.impl; |
||||
|
||||
import com.fr.design.DesignerEnvManager; |
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.general.locale.LocaleMark; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Locale; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Hades |
||||
* @date 2019/6/24 |
||||
*/ |
||||
public class SplashMark implements LocaleMark<String> { |
||||
|
||||
private Map<Locale, String> map = new HashMap<Locale, String>(); |
||||
private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; |
||||
private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_10_en.gif"; |
||||
private static final String SPLASH_JP_PATH = "/com/fr/design/images/splash_10_jp.gif"; |
||||
|
||||
public SplashMark() { |
||||
map.put(Locale.CHINA, SPLASH_PATH); |
||||
map.put(Locale.KOREA, SPLASH_EN_PATH); |
||||
map.put(Locale.JAPAN, SPLASH_JP_PATH); |
||||
map.put(Locale.US, SPLASH_EN_PATH); |
||||
map.put(Locale.TAIWAN, SPLASH_EN_PATH); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
String result = map.get(DesignerEnvManager.getEnvManager().getLanguage()); |
||||
return result == null ? SPLASH_EN_PATH : result; |
||||
} |
||||
} |
@ -0,0 +1,44 @@
|
||||
package com.fr.design.locale.impl; |
||||
|
||||
import com.fr.general.locale.SupportLocale; |
||||
|
||||
import java.util.HashSet; |
||||
import java.util.Locale; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* 某些国际化环境支持的操作 |
||||
* 需要增加/删除支持的语言 统一在这里修改 无须改动业务代码 |
||||
* 后续有新的不同语言下的差异操作 添加新的枚举 |
||||
* @author Hades |
||||
* @date 2019/6/24 |
||||
*/ |
||||
public enum SupportLocaleImpl implements SupportLocale { |
||||
|
||||
/** |
||||
* 社区菜单支持的国际化环境 |
||||
*/ |
||||
COMMUNITY { |
||||
@Override |
||||
public Set<Locale> support() { |
||||
Set<Locale> set = new HashSet<Locale>(); |
||||
set.add(Locale.CHINA); |
||||
set.add(Locale.TAIWAN); |
||||
return set; |
||||
} |
||||
}, |
||||
|
||||
/** |
||||
* Facebook支持的国际化环境 |
||||
*/ |
||||
FACEBOOK { |
||||
@Override |
||||
public Set<Locale> support() { |
||||
Set<Locale> set = new HashSet<Locale>(); |
||||
set.add(Locale.TAIWAN); |
||||
return set; |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,36 @@
|
||||
package com.fr.design.locale.impl; |
||||
|
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.general.locale.LocaleMark; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Locale; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Hades |
||||
* @date 2019/6/24 |
||||
*/ |
||||
public class UserInfoMark implements LocaleMark<String> { |
||||
|
||||
private Map<Locale, String> map = new HashMap<>(); |
||||
private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); |
||||
private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); |
||||
private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); |
||||
private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); |
||||
|
||||
public UserInfoMark() { |
||||
map.put(Locale.CHINA, CN_LOGIN_HTML); |
||||
map.put(Locale.KOREA, EN_LOGIN_HTML); |
||||
map.put(Locale.JAPAN, JP_LOGIN_HTML); |
||||
map.put(Locale.US, EN_LOGIN_HTML); |
||||
map.put(Locale.TAIWAN, TW_LOGIN_HTML); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
String result = map.get(GeneralContext.getLocale()); |
||||
return result == null ? EN_LOGIN_HTML : result; |
||||
} |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.fr.design.locale.impl; |
||||
|
||||
import com.fr.general.CloudCenter; |
||||
import com.fr.general.GeneralContext; |
||||
import com.fr.general.locale.LocaleMark; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Locale; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author Hades |
||||
* @date 2019/6/24 |
||||
*/ |
||||
public class VideoMark implements LocaleMark<String> { |
||||
|
||||
private Map<Locale, String> map = new HashMap<>(); |
||||
private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en"); |
||||
private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video"); |
||||
private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.tw"); |
||||
|
||||
public VideoMark() { |
||||
map.put(Locale.CHINA, VIDEO_CN); |
||||
map.put(Locale.KOREA, VIDEO_EN); |
||||
map.put(Locale.JAPAN, VIDEO_EN); |
||||
map.put(Locale.US, VIDEO_EN); |
||||
map.put(Locale.TAIWAN, VIDEO_TW); |
||||
} |
||||
|
||||
@Override |
||||
public String getValue() { |
||||
String result = map.get(GeneralContext.getLocale()); |
||||
return result == null ? VIDEO_EN : result; |
||||
} |
||||
} |
Loading…
Reference in new issue