mirror of
https://github.com/nitu2003/T18n
synced 2024-11-13 02:38:46 +00:00
[-/+] 再修改一点点
This commit is contained in:
parent
4eef26a4c8
commit
009699b11e
@ -61,26 +61,13 @@ public class I18n {
|
||||
|
||||
}
|
||||
|
||||
/** 使字符串列表扁平化。 */
|
||||
private static String flattenList(List<String> vlist) {
|
||||
|
||||
String v = "";
|
||||
for(String o : vlist) {
|
||||
v += o + "\n";
|
||||
}
|
||||
v = v.trim();
|
||||
|
||||
return v;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 将列表翻译中的内容进行format操作。
|
||||
* @see #translateList(String)
|
||||
*/
|
||||
public static String formatList(String keyRegular, Object...format) {
|
||||
|
||||
return tryFormat(flattenList(translateList(keyRegular)), format);
|
||||
return tryFormat(T18nUtils.flattenList(translateList(keyRegular)), format);
|
||||
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class T18nUtils {
|
||||
|
||||
try {
|
||||
|
||||
String content = I18n.flattenList(map.getAllKeyValuePairs());
|
||||
String content = flattenList(map.getAllKeyValuePairs());
|
||||
|
||||
if(!file.exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
@ -85,4 +85,17 @@ public class T18nUtils {
|
||||
|
||||
}
|
||||
|
||||
/** 使字符串列表扁平化。 */
|
||||
public static String flattenList(List<String> vlist) {
|
||||
|
||||
String v = "";
|
||||
for(String o : vlist) {
|
||||
v += o + "\n";
|
||||
}
|
||||
v = v.trim();
|
||||
|
||||
return v;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user