提交 b94a2268 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 37143363
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
90130=This method is not allowed for a prepared statement; use a regular statement instead. 90130=This method is not allowed for a prepared statement; use a regular statement instead.
90131=Concurrent update in table {0}\: another transaction has updated or deleted the same row 90131=Concurrent update in table {0}\: another transaction has updated or deleted the same row
90132=Aggregate {0} not found 90132=Aggregate {0} not found
90133=Cannot change the setting {0} when the database is already open
HY000=General error\: {0} HY000=General error\: {0}
HY004=Unknown data type\: {0} HY004=Unknown data type\: {0}
HYC00=Feature not supported HYC00=Feature not supported
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
90130=Diese Methode ist nicht erlaubt f\u00FCr ein PreparedStatement; ben\u00FCtzen Sie ein Statement. 90130=Diese Methode ist nicht erlaubt f\u00FCr ein PreparedStatement; ben\u00FCtzen Sie ein Statement.
90131=Gleichzeitige \u00C4nderung in Tabelle {0}\: eine andere Transaktion hat den gleichen Datensatz ge\u00E4ndert oder gel\u00F6scht 90131=Gleichzeitige \u00C4nderung in Tabelle {0}\: eine andere Transaktion hat den gleichen Datensatz ge\u00E4ndert oder gel\u00F6scht
90132=Aggregat-Funktion {0} nicht gefunden 90132=Aggregat-Funktion {0} nicht gefunden
90133=\#Cannot change the setting {0} when the database is already open
HY000=Allgemeiner Fehler\: {0} HY000=Allgemeiner Fehler\: {0}
HY004=Unbekannter Datentyp\: {0} HY004=Unbekannter Datentyp\: {0}
HYC00=Dieses Feature wird unterst\u00FCtzt HYC00=Dieses Feature wird unterst\u00FCtzt
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
90130=\u30D7\u30EA\u30DA\u30A2\u30C9\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306B\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u8A31\u3055\u308C\u3066\u3044\u307E\u305B\u3093; \u304B\u308F\u308A\u306B\u901A\u5E38\u306E\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 90130=\u30D7\u30EA\u30DA\u30A2\u30C9\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306B\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u8A31\u3055\u308C\u3066\u3044\u307E\u305B\u3093; \u304B\u308F\u308A\u306B\u901A\u5E38\u306E\u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
90131=\u30C6\u30FC\u30D6\u30EB {0} \u306B\u4E26\u884C\u3057\u3066\u66F4\u65B0\u304C\u884C\u308F\u308C\u307E\u3057\u305F\: \u5225\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3\u304C\u3001\u540C\u3058\u884C\u306B\u66F4\u65B0\u304B\u524A\u9664\u3092\u884C\u3044\u307E\u3057\u305F 90131=\u30C6\u30FC\u30D6\u30EB {0} \u306B\u4E26\u884C\u3057\u3066\u66F4\u65B0\u304C\u884C\u308F\u308C\u307E\u3057\u305F\: \u5225\u306E\u30C8\u30E9\u30F3\u30B6\u30AF\u30B7\u30E7\u30F3\u304C\u3001\u540C\u3058\u884C\u306B\u66F4\u65B0\u304B\u524A\u9664\u3092\u884C\u3044\u307E\u3057\u305F
90132=\#Aggregate {0} not found 90132=\#Aggregate {0} not found
90133=\#Cannot change the setting {0} when the database is already open
HY000=\u4E00\u822C\u30A8\u30E9\u30FC\: {0} HY000=\u4E00\u822C\u30A8\u30E9\u30FC\: {0}
HY004=\u4E0D\u660E\u306A\u30C7\u30FC\u30BF\u578B\: {0} HY004=\u4E0D\u660E\u306A\u30C7\u30FC\u30BF\u578B\: {0}
HYC00=\u6A5F\u80FD\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 HYC00=\u6A5F\u80FD\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
90130=\#This method is not allowed for a prepared statement; use a regular statement instead. 90130=\#This method is not allowed for a prepared statement; use a regular statement instead.
90131=\#Concurrent update in table {0}\: another transaction has updated or deleted the same row 90131=\#Concurrent update in table {0}\: another transaction has updated or deleted the same row
90132=\#Aggregate {0} not found 90132=\#Aggregate {0} not found
90133=\#Cannot change the setting {0} when the database is already open
HY000=Blad ogolny\: {0} HY000=Blad ogolny\: {0}
HY004=Nieznany typ danyche\: {0} HY004=Nieznany typ danyche\: {0}
HYC00=Cecha nie jest wspierana HYC00=Cecha nie jest wspierana
......
...@@ -24,11 +24,19 @@ import org.h2.util.IOUtils; ...@@ -24,11 +24,19 @@ import org.h2.util.IOUtils;
import org.h2.util.SortedProperties; import org.h2.util.SortedProperties;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import com.google.api.translate.Language;
import com.google.api.translate.Translate;
public class PrepareTranslation { public class PrepareTranslation {
private static final String MAIN_LANGUAGE = "en"; private static final String MAIN_LANGUAGE = "en";
private static final String DELETED_PREFIX = "~"; private static final String DELETED_PREFIX = "~";
private static final boolean AUTO_TRANSLATE = false;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
new PrepareTranslation().run(args);
}
private void run(String[] args) throws Exception {
String baseDir = "src/docsrc/textbase"; String baseDir = "src/docsrc/textbase";
prepare(baseDir, "src/main/org/h2/res"); prepare(baseDir, "src/main/org/h2/res");
prepare(baseDir, "src/main/org/h2/server/web/res"); prepare(baseDir, "src/main/org/h2/server/web/res");
...@@ -368,7 +376,7 @@ public class PrepareTranslation { ...@@ -368,7 +376,7 @@ public class PrepareTranslation {
prop.setProperty(document, s); prop.setProperty(document, s);
} }
private static void prepare(String baseDir, String path) throws IOException { private void prepare(String baseDir, String path) throws IOException {
File dir = new File(path); File dir = new File(path);
File[] list = dir.listFiles(); File[] list = dir.listFiles();
File main = null; File main = null;
...@@ -389,13 +397,13 @@ public class PrepareTranslation { ...@@ -389,13 +397,13 @@ public class PrepareTranslation {
for (int i = 0; i < translations.size(); i++) { for (int i = 0; i < translations.size(); i++) {
File trans = (File) translations.get(i); File trans = (File) translations.get(i);
String language = trans.getName(); String language = trans.getName();
// language = language.substring(language.lastIndexOf('_'), language.lastIndexOf('.')); language = language.substring(language.lastIndexOf('_') + 1, language.lastIndexOf('.'));
prepare(p, base, trans); prepare(p, base, trans, language);
} }
PropertiesToUTF8.storeProperties(p, baseDir + "/" + main.getName()); PropertiesToUTF8.storeProperties(p, baseDir + "/" + main.getName());
} }
private static void prepare(Properties main, Properties base, File trans) throws IOException { private void prepare(Properties main, Properties base, File trans, String language) throws IOException {
Properties p = FileUtils.loadProperties(trans.getAbsolutePath()); Properties p = FileUtils.loadProperties(trans.getAbsolutePath());
Properties oldTranslations = new Properties(); Properties oldTranslations = new Properties();
for (Iterator it = base.keySet().iterator(); it.hasNext();) { for (Iterator it = base.keySet().iterator(); it.hasNext();) {
...@@ -437,7 +445,7 @@ public class PrepareTranslation { ...@@ -437,7 +445,7 @@ public class PrepareTranslation {
System.out.println(trans.getName() + ": key " + key + " changed, please review; last=" + last System.out.println(trans.getName() + ": key " + key + " changed, please review; last=" + last
+ " now=" + now); + " now=" + now);
String old = p.getProperty(key); String old = p.getProperty(key);
t = "#" + now + " #" + old; t = "#" + autoTranslate(now, language) + " #" + old;
} }
p.put(key, t); p.put(key, t);
} }
...@@ -463,4 +471,19 @@ public class PrepareTranslation { ...@@ -463,4 +471,19 @@ public class PrepareTranslation {
} }
PropertiesToUTF8.storeProperties(p, trans.getAbsolutePath()); PropertiesToUTF8.storeProperties(p, trans.getAbsolutePath());
} }
private String autoTranslate(String original, String language) {
String translation = original;
if (!AUTO_TRANSLATE) {
return "#" + translation;
}
if ("de".equals(language)) {
try {
return "#" + Translate.translate(original, Language.ENGLISH, Language.GERMAN);
} catch (IOException e) {
e.printStackTrace();
}
}
return "#" + translation;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论