Browse Source
Merge in DESIGN/design from ~OBO/design:release/11.0 to release/11.0 * commit '8166e8dbf948f42df556d95cf49aaa3bcc7e4489': REPORT-91074 【国际化】超链接区分设计器版本 REPORT-91074 【国际化】超链接区分设计器版本 REPORT-91074 【国际化】超链接区分设计器版本newui
Obo-王学仁
2 years ago
34 changed files with 506 additions and 201 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