Skip to content

Commit

Permalink
0.36
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed Dec 16, 2018
1 parent d3bb2b1 commit d02c147
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.xenoamess</groupId>
<artifactId>multi_language</artifactId>
<version>0.30</version>
<version>0.31</version>

<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public MultiLanguageStructure() {
}


public boolean SetCurrentLanguage(String newCurrentLanguage) {
public boolean setCurrentLanguage(String newCurrentLanguage) {
if (languageMap.containsKey(newCurrentLanguage)) {
currentLanguage = newCurrentLanguage;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
Expand All @@ -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);
}

Expand All @@ -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 {
Expand All @@ -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);
Expand All @@ -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)) {
Expand All @@ -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]);
Expand Down Expand Up @@ -376,7 +376,7 @@ protected void sortSingleNode(Comparator<String> 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<TreeNode>();
}
Expand Down Expand Up @@ -463,7 +463,7 @@ public MultiLanguageX8lFileUtil completeMissingLanguageNodes() {
if (contentNode11.attributesKeyList.isEmpty()) {
continue;
}
languageSet1.add(contentNode11.attributesKeyList.get(0));
languageSet1.add(contentNode11.getName());
}
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d02c147

Please sign in to comment.