From d02c14778b6bed2587e1f50e5f1221f2f55d3e8d Mon Sep 17 00:00:00 2001 From: XenoAmess Date: Mon, 17 Dec 2018 00:59:24 +0800 Subject: [PATCH] 0.36 --- pom.xml | 2 +- .../MultiLanguageStructure.java | 2 +- .../MultiLanguageX8lFileUtil.java | 29 +++++++++---------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index cf9e0b6..71a224c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.xenoamess multi_language - 0.30 + 0.31 diff --git a/src/main/java/com/xenoamess/multi_language/MultiLanguageStructure.java b/src/main/java/com/xenoamess/multi_language/MultiLanguageStructure.java index 300f3ae..fd9b7e0 100644 --- a/src/main/java/com/xenoamess/multi_language/MultiLanguageStructure.java +++ b/src/main/java/com/xenoamess/multi_language/MultiLanguageStructure.java @@ -19,7 +19,7 @@ public MultiLanguageStructure() { } - public boolean SetCurrentLanguage(String newCurrentLanguage) { + public boolean setCurrentLanguage(String newCurrentLanguage) { if (languageMap.containsKey(newCurrentLanguage)) { currentLanguage = newCurrentLanguage; return true; diff --git a/src/main/java/com/xenoamess/multi_language/MultiLanguageX8lFileUtil.java b/src/main/java/com/xenoamess/multi_language/MultiLanguageX8lFileUtil.java index c0ea434..36ebf10 100644 --- a/src/main/java/com/xenoamess/multi_language/MultiLanguageX8lFileUtil.java +++ b/src/main/java/com/xenoamess/multi_language/MultiLanguageX8lFileUtil.java @@ -66,7 +66,7 @@ public void mergeFromSplit(X8lTree newX8lTree) { if (nowNode1.attributesKeyList.isEmpty()) { continue; } - String nowID = nowNode1.attributesKeyList.get(0); + String nowID = nowNode1.getName(); contentNodes.put(nowID, nowNode1); } @@ -82,7 +82,7 @@ public void mergeFromSplit(X8lTree newX8lTree) { treeNode2.changeParentAndRegister(nowRoot1); continue; } - String nowID2 = nowNode2.attributesKeyList.get(0); + String nowID2 = nowNode2.getName(); if (!contentNodes.containsKey(nowID2)) { ContentNode contentNode2 = new ContentNode(nowRoot1); contentNode2.addAttribute(nowID2); @@ -95,7 +95,7 @@ public void mergeFromSplit(X8lTree newX8lTree) { for (TreeNode treeNode11 : nowNode1.children) { if ((treeNode11 instanceof ContentNode) && !((ContentNode) treeNode11).attributesKeyList.isEmpty() && - ((ContentNode) treeNode11).attributesKeyList.get(0).equals(languageName)) { + ((ContentNode) treeNode11).getName().equals(languageName)) { treeNode11.destroy(); break; } @@ -137,7 +137,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { if (nowNode1.attributesKeyList.isEmpty()) { continue; } - String nowID = nowNode1.attributesKeyList.get(0); + String nowID = nowNode1.getName(); contentNodes.put(nowID, nowNode1); } @@ -153,7 +153,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { treeNode2.changeParentAndRegister(nowRoot1); continue; } - String nowID2 = nowNode2.attributesKeyList.get(0); + String nowID2 = nowNode2.getName(); if (!contentNodes.containsKey(nowID2)) { treeNode2.parent = null; treeNode2.changeParentAndRegister(nowRoot1); @@ -174,7 +174,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { continue; } TextNode textNode11 = (TextNode) contentNode11.children.get(0); - String key = contentNode11.attributesKeyList.get(0); + String key = contentNode11.getName(); languageMap.put(key, textNode11); } @@ -197,7 +197,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { continue; } TextNode textNode12 = (TextNode) contentNode12.children.get(0); - String key = contentNode12.attributesKeyList.get(0); + String key = contentNode12.getName(); if (languageMap.containsKey(key)) { languageMap.get(key).textContent = textNode12.textContent; } else { @@ -219,7 +219,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { // continue; // } // TextNode textNode11 = (TextNode) contentNode11.children.get(0); -// String key = contentNode11.attributesKeyList.get(0); +// String key = contentNode11.getName(); //// String value = textNode11.textContent; // textNode11.textContent = languageMap.get(key); // languageMap.remove(key); @@ -232,7 +232,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { //// } // // for (TreeNode treeNode12 : nowNode.children) { -//// String nowID = Integer.parseInt(nowNode.attributesKeyList.get(0)); +//// String nowID = Integer.parseInt(nowNode.getName()); //// contentNodes[nowID] = nowNode; // // if (!(treeNode12 instanceof ContentNode)) { @@ -256,7 +256,7 @@ public void mergeFromMerge(X8lTree newX8lTree) { // continue; // } // TextNode textNode11 = (TextNode) contentNode12.children.get(0); -// String key = contentNode12.attributesKeyList.get(0); +// String key = contentNode12.getName(); //// String value = textNode11.textContent; // if (languageMap.containsKey(key)) { // treeNode12.changeParentAndRegister(contentNodes[nowID]); @@ -376,7 +376,7 @@ protected void sortSingleNode(Comparator comparator, ContentNode nowNode if (nowNode11.attributesKeyList.isEmpty()) { continue; } - String nowID = nowNode11.attributesKeyList.get(0); + String nowID = nowNode11.getName(); contentNodeMap.put(nowID, treeNodes); treeNodes = new ArrayList(); } @@ -463,7 +463,7 @@ public MultiLanguageX8lFileUtil completeMissingLanguageNodes() { if (contentNode11.attributesKeyList.isEmpty()) { continue; } - languageSet1.add(contentNode11.attributesKeyList.get(0)); + languageSet1.add(contentNode11.getName()); } } @@ -485,7 +485,7 @@ public MultiLanguageX8lFileUtil completeMissingLanguageNodes() { if (contentNode11.attributesKeyList.isEmpty()) { continue; } - languageSet2.remove(contentNode11.attributesKeyList.get(0)); + languageSet2.remove(contentNode11.getName()); } for (String languageName : languageSet2) { @@ -527,11 +527,10 @@ public MultiLanguageStructure parse() { continue; } String textValue = ((TextNode) treeNode111).textContent; - res.putText(languageName, textID, textValue); + res.putText(languageName, X8lTree.Untranscode(textID), X8lTree.Untranscode(textValue)); } } } - return res; }