Skip to content

Commit

Permalink
update find missing localization script
Browse files Browse the repository at this point in the history
  • Loading branch information
judos committed Mar 27, 2016
1 parent 4b4cde1 commit 19e3c2c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
16 changes: 12 additions & 4 deletions missingLocalization/SearchMissingLabelsInLanguages.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.HashSet;

import ch.judos.generic.data.ArraysJS;
import ch.judos.generic.files.FileUtils;

public class SearchMissingLabelsInLanguages {

Expand All @@ -14,9 +15,10 @@ public static void main(String[] args) throws IOException {
}

public static String sourceLanguage = "en";
public static String[] searchLang = {"ru", "zh-CN"};
public static String[] searchLang = {"ru", "zh-CN", "fr"};
public static String baseLocalePath = "D:/modding/factorio/hardCrafting/source/locale/";
public static String[] excludedFiles = {"generated.cfg", "generated-2.cfg"};
public static String outDir = "D:/modding/factorio/hardCrafting/missingLocalization/missingLabelsInLanguages/";

private ArrayList<Label> existingLabels;
public SearchMissingLabelsInLanguages() throws IOException {
Expand All @@ -36,12 +38,18 @@ private void checkAllLabelsExist(String lang) throws IOException {
missingLabel.remove(label);
}
};
File file = new File(outDir + lang + ".txt");
if (missingLabel.size() > 0) {
System.out.println("Found missing labels in language: " + lang);
System.out.println(lang + ": Found " + missingLabel.size()
+ " missing labels. See " + lang + ".txt");
StringBuffer output = new StringBuffer();
for (Label l : missingLabel) {
System.out.println(l);
output.append(l + "\n");
}
System.out.println();
FileUtils.writeToFile(file, output.toString());
}
else if (file.exists()) {
file.delete();
}
}

Expand Down
18 changes: 18 additions & 0 deletions missingLocalization/missingLabelsInLanguages/ru.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
recipe-description.dried-dirt
technology-description.steel-processing-2
technology-name.steel-processing-2
item-description.scrap-metal
technology-description.belt-sorter
recipe-description.scrap-metal-processing
item-name.scrap-metal
recipe-name.dried-dirt
entity-description.belt-sorter
item-name.coal-dust
technology-name.belt-sorter
item-description.steel-dust
recipe-description.sulfur-dust
entity-name.belt-sorter
item-description.coal-dust
item-name.steel-dust
item-name.dried-dirt
recipe-name.scrap-metal-processing
16 changes: 16 additions & 0 deletions missingLocalization/missingLabelsInLanguages/zh-CN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
recipe-description.dried-dirt
technology-description.steel-processing-2
technology-name.steel-processing-2
item-description.scrap-metal
technology-description.belt-sorter
recipe-description.scrap-metal-processing
item-name.scrap-metal
recipe-name.dried-dirt
entity-description.belt-sorter
technology-name.belt-sorter
item-description.steel-dust
recipe-description.sulfur-dust
entity-name.belt-sorter
item-name.steel-dust
item-name.dried-dirt
recipe-name.scrap-metal-processing

0 comments on commit 19e3c2c

Please sign in to comment.