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.
|
|
|
package com.fanruan.api.i18n;
|
|
|
|
|
|
|
|
import com.fr.locale.InterProviderFactory;
|
|
|
|
|
|
|
|
import java.util.Locale;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
public class I18nKit {
|
|
|
|
/**
|
|
|
|
* 获取国际化文本
|
|
|
|
*
|
|
|
|
* @param string 需要国际化的值对应的键
|
|
|
|
* @return 返回国际化文本
|
|
|
|
*/
|
|
|
|
public static String getLocText(String string) {
|
|
|
|
return InterProviderFactory.getProvider().getLocText(string);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取国际化文本
|
|
|
|
*
|
|
|
|
* @param string 需要国际化的值对应的键
|
|
|
|
* @param args 变量
|
|
|
|
* @return 返回国际化文本
|
|
|
|
*/
|
|
|
|
public static String getLocText(String string, String... args) {
|
|
|
|
return InterProviderFactory.getProvider().getLocText(string, args);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取某种语言下所有的国际化键值对
|
|
|
|
*
|
|
|
|
* @param locale 国际化
|
|
|
|
* @return 国际化键值对集合
|
|
|
|
*/
|
|
|
|
public static Map<String, String> getEntireKV(Locale locale) {
|
|
|
|
return InterProviderFactory.getClientProvider().getEntireKV(locale);
|
|
|
|
}
|
|
|
|
}
|