Skip to content

Commit 7f5d2b3

Browse files
committed
Improve xml to json converter.
1 parent 5a16df0 commit 7f5d2b3

File tree

3 files changed

+3995
-7971
lines changed

3 files changed

+3995
-7971
lines changed

src/main/java/com/github/nosql/Nosql.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private static void processCommandLine(CommandLine cmd) throws Exception {
8787
List<Map<String, Object>> textsEn = new ArrayList<>();
8888
List<Map<String, Object>> textsDe = new ArrayList<>();
8989
List<Map<String, Object>> textsRu = new ArrayList<>();
90+
List<Map<String, Object>> textsUa = new ArrayList<>();
9091
for (Map<String, Object> textItem : texts) {
9192
Map<String, Object> textItemEn = new LinkedHashMap<>();
9293
textItemEn.put("-id", textItem.get("-id"));
@@ -100,13 +101,19 @@ private static void processCommandLine(CommandLine cmd) throws Exception {
100101
textItemRu.put("-id", textItem.get("-id"));
101102
textItemRu.put("ru", textItem.get("ru"));
102103
textsRu.add(textItemRu);
104+
Map<String, Object> textItemUa = new LinkedHashMap<>();
105+
textItemUa.put("-id", textItem.get("-id"));
106+
textItemUa.put("ua", textItem.get("ua"));
107+
textsUa.add(textItemUa);
103108
}
104109
final Path pathEn = Paths.get("", new String[] { file.getPath().replaceFirst("\\.xml$", "-en.json") });
105110
final Path pathDe = Paths.get("", new String[] { file.getPath().replaceFirst("\\.xml$", "-de.json") });
106111
final Path pathRu = Paths.get("", new String[] { file.getPath().replaceFirst("\\.xml$", "-ru.json") });
112+
final Path pathUa = Paths.get("", new String[] { file.getPath().replaceFirst("\\.xml$", "-ua.json") });
107113
Files.write(pathEn, Json.toJson(textsEn).getBytes(StandardCharsets.UTF_8));
108114
Files.write(pathDe, Json.toJson(textsDe).getBytes(StandardCharsets.UTF_8));
109115
Files.write(pathRu, Json.toJson(textsRu).getBytes(StandardCharsets.UTF_8));
116+
Files.write(pathUa, Json.toJson(textsUa).getBytes(StandardCharsets.UTF_8));
110117
} catch (Exception ex) {
111118
System.out.println(file.getPath() + " - " + ex.getMessage());
112119
}

texts-ru.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,15 +3465,15 @@
34653465
},
34663466
{
34673467
"-id": "MsgEventRatingDisallowed",
3468-
"ru": "Модератор {author} запретил вам оценивать сообещния."
3468+
"ru": "Модератор {author} запретил вам оценивать сообещения."
34693469
},
34703470
{
34713471
"-id": "MsgEventRatingDisallowedAnonym",
34723472
"ru": "Для вас установлен запрет на оценку сообщений."
34733473
},
34743474
{
34753475
"-id": "MsgEventRatingAllowed",
3476-
"ru": "Модератор {author} снял с вас запрет на оценку сообещний."
3476+
"ru": "Модератор {author} снял с вас запрет на оценку сообещений."
34773477
},
34783478
{
34793479
"-id": "MsgEventRatingAllowedAnonym",
@@ -3577,7 +3577,7 @@
35773577
},
35783578
{
35793579
"-id": "LastWeek",
3580-
"ru": "Последняя Неделя"
3580+
"ru": "Последняя неделя"
35813581
},
35823582
{
35833583
"-id": "LastMonth",
@@ -3917,7 +3917,7 @@
39173917
},
39183918
{
39193919
"-id": "MsgProfileImportSuccess",
3920-
"ru": "Профиль успешно испортирован."
3920+
"ru": "Профиль успешно импортирован."
39213921
},
39223922
{
39233923
"-id": "ErrImportFileNotSpecified",

0 commit comments

Comments
 (0)