You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.5 KiB
40 lines
1.5 KiB
8 years ago
|
package org.libresonic.player;
|
||
8 years ago
|
|
||
|
import java.io.IOException;
|
||
|
import java.util.Map;
|
||
|
import java.util.Properties;
|
||
|
import java.util.SortedMap;
|
||
|
import java.util.TreeMap;
|
||
|
|
||
|
public class MissingTranslations {
|
||
|
|
||
|
public static void main(String[] args) throws IOException {
|
||
|
String[] locales = {"da", "de", "es", "pt", "fi", "fr", "is", "it", "ja_JP", "mk", "nl", "no", "pl", "ru", "sl", "sv", "zh_CN", "zh_TW"};
|
||
|
|
||
|
for (String locale : locales) {
|
||
|
diff(locale, "en");
|
||
|
// diff("en", locale);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private static void diff(String locale1, String locale2) throws IOException {
|
||
|
Properties en = new Properties();
|
||
8 years ago
|
en.load(MissingTranslations.class.getResourceAsStream("/org/libresonic/player/i18n/ResourceBundle_" + locale1 + ".properties"));
|
||
8 years ago
|
SortedMap<Object,Object> enSorted = new TreeMap<Object, Object>(en);
|
||
|
|
||
|
Properties mk = new Properties();
|
||
8 years ago
|
mk.load(MissingTranslations.class.getResourceAsStream("/org/libresonic/player/i18n/ResourceBundle_" + locale2 + ".properties"));
|
||
8 years ago
|
|
||
|
System.out.println("\nMessages present in locale " + locale1 + " and missing in locale " + locale2 + ":");
|
||
|
int count = 0;
|
||
|
for (Map.Entry<Object, Object> entry : enSorted.entrySet()) {
|
||
|
if (!mk.containsKey(entry.getKey())) {
|
||
|
System.out.println(entry.getKey() + " = " + entry.getValue());
|
||
|
count++;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
System.out.println("\nTotal: " + count);
|
||
|
}
|
||
|
}
|