Merge pull request #158 from kruland2607/l10nReport
Added little l10n properties analysis tool, and fixed some obvious errors in cs & it localizations.
This commit is contained in:
commit
6cd1bffc82
@ -1308,8 +1308,7 @@ PlotConfiguration.Flightside = Letov
|
|||||||
PlotConfiguration.Stability = Stabilita vs. cas
|
PlotConfiguration.Stability = Stabilita vs. cas
|
||||||
PlotConfiguration.Dragcoef = Brzdící koeficient vs. Machovo císlo
|
PlotConfiguration.Dragcoef = Brzdící koeficient vs. Machovo císlo
|
||||||
PlotConfiguration.Rollcharacteristics = Charakteristiky prícného náklonu
|
PlotConfiguration.Rollcharacteristics = Charakteristiky prícného náklonu
|
||||||
PlotConfiguration.Angleofattack = Úhel nábehu a orientace
|
PlotConfiguration.Angleofattack = Úhel nábehu a orientace vs cas
|
||||||
vs cas
|
|
||||||
PlotConfiguration.Simulationtime = Simulacní krok a výpocetní cas
|
PlotConfiguration.Simulationtime = Simulacní krok a výpocetní cas
|
||||||
|
|
||||||
! Warning
|
! Warning
|
||||||
@ -1582,10 +1581,7 @@ CustomFinImport.errorParsingFile = Chyba behem zpracov
|
|||||||
CustomFinImport.undo = Importovat sadu volno tvarových stabilizátoru
|
CustomFinImport.undo = Importovat sadu volno tvarových stabilizátoru
|
||||||
CustomFinImport.error.title = Chyba behem nahrávání profilu stabilizátoru
|
CustomFinImport.error.title = Chyba behem nahrávání profilu stabilizátoru
|
||||||
CustomFinImport.error.badimage = Nemohu vyvodit tvar stabilizátoru z obrázku.
|
CustomFinImport.error.badimage = Nemohu vyvodit tvar stabilizátoru z obrázku.
|
||||||
CustomFinImport.description = Obrázek bude zmenen na cernobílý
|
CustomFinImport.description = Obrázek bude zmenen na cernobílý \n(cerná pro stabilizátor), ujistete se prosím, \u017Ee jste pou\u017Eily cernou barvu na stabilizátor \na bílou nebo svetlou barvu na pozadí. Stabilizátor \nse musí dotýkat steny obrázku, která predstavuje uchycení pro stabilizátor.
|
||||||
(cerná pro stabilizátor), ujistete se prosím, \u017Ee jste pou\u017Eily cernou barvu na stabilizátor
|
|
||||||
a bílou nebo svetlou barvu na pozadí. Stabilizátor
|
|
||||||
se musí dotýkat steny obrázku, která predstavuje uchycení pro stabilizátor.
|
|
||||||
|
|
||||||
|
|
||||||
PresetModel.lbl.select = Výber predvolby:
|
PresetModel.lbl.select = Výber predvolby:
|
||||||
|
@ -1350,7 +1350,7 @@ FlightDataType.TYPE_ROLL_FORCING_COEFF = Roll forcing coefficient
|
|||||||
FlightDataType.TYPE_ROLL_DAMPING_COEFF = Roll damping coefficient
|
FlightDataType.TYPE_ROLL_DAMPING_COEFF = Roll damping coefficient
|
||||||
FlightDataType.TYPE_PITCH_DAMPING_MOMENT_COEFF = Pitch damping coefficient
|
FlightDataType.TYPE_PITCH_DAMPING_MOMENT_COEFF = Pitch damping coefficient
|
||||||
FlightDataType.TYPE_YAW_DAMPING_MOMENT_COEFF = Yaw damping coefficient
|
FlightDataType.TYPE_YAW_DAMPING_MOMENT_COEFF = Yaw damping coefficient
|
||||||
FlightDataType.TYPE_REFERENCE_Lunghezza = Reference lenght
|
FlightDataType.TYPE_REFERENCE_LENGTH = Reference length
|
||||||
FlightDataType.TYPE_REFERENCE_AREA = Reference area
|
FlightDataType.TYPE_REFERENCE_AREA = Reference area
|
||||||
FlightDataType.TYPE_ORIENTATION_THETA = Orientazione verticale (zenith)
|
FlightDataType.TYPE_ORIENTATION_THETA = Orientazione verticale (zenith)
|
||||||
FlightDataType.TYPE_ORIENTATION_PHI = Orientazione laterale (azimuth)
|
FlightDataType.TYPE_ORIENTATION_PHI = Orientazione laterale (azimuth)
|
||||||
|
94
core/src/net/sf/openrocket/utils/L10nPropertyReport.java
Normal file
94
core/src/net/sf/openrocket/utils/L10nPropertyReport.java
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
package net.sf.openrocket.utils;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||||
|
|
||||||
|
public class L10nPropertyReport {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
Properties english;
|
||||||
|
|
||||||
|
Map<String, Properties> langs = new HashMap<String, Properties>();
|
||||||
|
|
||||||
|
System.out.println("Loading All Resource files");
|
||||||
|
|
||||||
|
english = new Properties();
|
||||||
|
InputStream in = L10nPropertyReport.class.getResourceAsStream("/l10n/messages.properties");
|
||||||
|
english.load(in);
|
||||||
|
|
||||||
|
System.out.println("en contains " + english.keySet().size());
|
||||||
|
|
||||||
|
|
||||||
|
for (Locale l : SwingPreferences.getSupportedLocales()) {
|
||||||
|
|
||||||
|
String localename = l.getLanguage();
|
||||||
|
|
||||||
|
if ("en".equals(localename)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Properties p = new Properties();
|
||||||
|
|
||||||
|
in = L10nPropertyReport.class.getResourceAsStream("/l10n/messages_" + localename + ".properties");
|
||||||
|
|
||||||
|
p.load(in);
|
||||||
|
|
||||||
|
System.out.println(localename + " contains " + p.keySet().size());
|
||||||
|
|
||||||
|
langs.put(localename, p);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for languages missing an en key:
|
||||||
|
|
||||||
|
List<String> sortedKeys = getSortedKeys(english);
|
||||||
|
|
||||||
|
for (String key : sortedKeys) {
|
||||||
|
|
||||||
|
List<String> missing = new ArrayList<String>(10);
|
||||||
|
|
||||||
|
for (Map.Entry<String, Properties> en : langs.entrySet()) {
|
||||||
|
if (en.getValue().getProperty(key) != null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
missing.add(en.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missing.size() > 0) {
|
||||||
|
System.out.println(key + " missing from " + missing);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check each locale for extra keys:
|
||||||
|
for (Map.Entry<String, Properties> lang : langs.entrySet()) {
|
||||||
|
System.out.println("Extra keys in " + lang.getKey());
|
||||||
|
|
||||||
|
sortedKeys = getSortedKeys(lang.getValue());
|
||||||
|
for (String key : sortedKeys) {
|
||||||
|
if (english.getProperty(key) == null) {
|
||||||
|
System.out.println("\t" + key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<String> getSortedKeys(Properties p) {
|
||||||
|
List<String> sortedKeys = new ArrayList<String>(p.keySet().size());
|
||||||
|
for (Object obj : p.keySet()) {
|
||||||
|
sortedKeys.add((String) obj);
|
||||||
|
}
|
||||||
|
Collections.sort(sortedKeys);
|
||||||
|
return sortedKeys;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user