Browse Source
# Conflicts: # designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java # designer-base/src/main/java/com/fr/design/actions/community/SignAction.java # designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java # designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.javafeature/x
obo
2 years ago
33 changed files with 475 additions and 179 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