Browse Source
Merge in DESIGN/design from ~OBO/design1:feature/x to feature/x * commit '69f2982c2bdd19c69e3d2285016b8666cb02a0ca': REPORT-91074 解决冲突 REPORT-91074 解决冲突 REPORT-91074 【国际化】超链接区分设计器版本 REPORT-91074 【国际化】超链接区分设计器版本 REPORT-91074 【国际化】超链接区分设计器版本feature/x
Obo-王学仁
2 years ago
34 changed files with 506 additions and 200 deletions
@ -0,0 +1,47 @@ |
|||||||
|
package com.fr.design.i18n; |
||||||
|
|
||||||
|
import com.fr.general.CloudCenter; |
||||||
|
import com.fr.stable.StringUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* 国际化链接获取工具 |
||||||
|
* 根据配置文件key获取云中心key对应的链接或者默认链接 |
||||||
|
* |
||||||
|
* @author obo |
||||||
|
* @since 11.0 |
||||||
|
* Created on 2023/4/7 |
||||||
|
*/ |
||||||
|
public final class LocaleLinkProvider { |
||||||
|
|
||||||
|
private LocaleLinkProvider(){}; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单一实例 |
||||||
|
*/ |
||||||
|
private static final LocaleLinkProvider INSTANCE = new LocaleLinkProvider(); |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回LocaleLinkProvider的单一实例 |
||||||
|
* |
||||||
|
* @return LocaleLinkProvider单一实例 |
||||||
|
*/ |
||||||
|
public static LocaleLinkProvider getInstance(){ |
||||||
|
return INSTANCE; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 根据配置文件项中的key获取链接 |
||||||
|
* |
||||||
|
* @param propsKey 配置项key |
||||||
|
* @param defaultKey 默认链接项key |
||||||
|
* @return 对应的生成器 |
||||||
|
*/ |
||||||
|
public String getLink(String propsKey, String defaultKey) { |
||||||
|
String cloudKey = DesignI18nImpl.getInstance().i18nText(propsKey); |
||||||
|
String url = CloudCenter.getInstance().acquireUrlByKind(cloudKey); |
||||||
|
if(StringUtils.isEmpty(url)) { |
||||||
|
return DesignI18nImpl.getInstance().i18nText(defaultKey); |
||||||
|
} |
||||||
|
return url; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue