From 009699b11e1063e5dc4e69f34a730ea7e004900c Mon Sep 17 00:00:00 2001 From: Taskeren Date: Sun, 7 Jul 2019 14:22:20 +0800 Subject: [PATCH] =?UTF-8?q?[-/+]=20=E5=86=8D=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E7=82=B9=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/glycol/t18n/I18n.java | 15 +-------------- src/main/java/cn/glycol/t18n/T18nUtils.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/cn/glycol/t18n/I18n.java b/src/main/java/cn/glycol/t18n/I18n.java index 816e193..005d71b 100644 --- a/src/main/java/cn/glycol/t18n/I18n.java +++ b/src/main/java/cn/glycol/t18n/I18n.java @@ -61,26 +61,13 @@ public class I18n { } - /** 使字符串列表扁平化。 */ - private static String flattenList(List 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); } diff --git a/src/main/java/cn/glycol/t18n/T18nUtils.java b/src/main/java/cn/glycol/t18n/T18nUtils.java index 565e199..20ca6de 100644 --- a/src/main/java/cn/glycol/t18n/T18nUtils.java +++ b/src/main/java/cn/glycol/t18n/T18nUtils.java @@ -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 vlist) { + + String v = ""; + for(String o : vlist) { + v += o + "\n"; + } + v = v.trim(); + + return v; + + } + }