You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.7 KiB
57 lines
1.7 KiB
package com.fr.design.i18n; |
|
|
|
import com.fr.config.ConfigContext; |
|
import com.fr.config.DefaultConfiguration; |
|
import com.fr.config.Identifier; |
|
import com.fr.config.holder.factory.Holders; |
|
import com.fr.config.holder.impl.MapConf; |
|
|
|
import java.util.Collections; |
|
import java.util.HashMap; |
|
import java.util.Map; |
|
|
|
/** |
|
* 设计器语言扩展配置 |
|
* |
|
* @author obo |
|
* @since 11.0 |
|
* Created on 2024/09/26 |
|
*/ |
|
public class DesignExtendLanguageConfig extends DefaultConfiguration { |
|
|
|
private static volatile DesignExtendLanguageConfig designExtendLanguageConfig = null; |
|
|
|
/** |
|
* |
|
* @return |
|
*/ |
|
public static DesignExtendLanguageConfig getInstance() { |
|
if (designExtendLanguageConfig == null) { |
|
designExtendLanguageConfig = ConfigContext.getConfigInstance(DesignExtendLanguageConfig.class); |
|
} |
|
return designExtendLanguageConfig; |
|
} |
|
|
|
/** |
|
* 设计器扩展的语言 |
|
* key为localeString,例如en_US或en;value为改语言对应的国际化翻译key |
|
*/ |
|
@Identifier("extendDesignLocales") |
|
private MapConf<Map<String, String>> extendDesignLocales = Holders.map(new HashMap<>(), String.class, String.class); |
|
|
|
public Map<String, String> getExtendedDesignLocales() { |
|
return Collections.unmodifiableMap(extendDesignLocales.get()); |
|
} |
|
|
|
public void setExtendedDesignLocales(Map<String, String> map) { |
|
extendDesignLocales.set(map); |
|
} |
|
|
|
@Override |
|
public Object clone() throws CloneNotSupportedException { |
|
DesignExtendLanguageConfig cloned = (DesignExtendLanguageConfig) super.clone(); |
|
cloned.extendDesignLocales = ( MapConf<Map<String, String>>) extendDesignLocales.clone(); |
|
return cloned; |
|
} |
|
|
|
}
|
|
|