Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4b83637b
提交
4b83637b
authored
8月 11, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
86af6c4c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
62 行增加
和
23 行删除
+62
-23
Message.java
h2/src/main/org/h2/message/Message.java
+1
-1
Doclet.java
h2/src/tools/org/h2/tools/doclet/Doclet.java
+1
-1
PrepareTranslation.java
h2/src/tools/org/h2/tools/i18n/PrepareTranslation.java
+60
-21
没有找到文件。
h2/src/main/org/h2/message/Message.java
浏览文件 @
4b83637b
...
...
@@ -85,7 +85,7 @@ public class Message {
}
public
static
JdbcSQLException
getSQLException
(
int
errorCode
,
String
[]
param
)
{
return
getSQLException
(
errorCode
,
param
);
return
getSQLException
(
errorCode
,
param
,
null
);
}
public
static
SQLException
getSyntaxError
(
String
sql
,
int
index
)
{
...
...
h2/src/tools/org/h2/tools/doclet/Doclet.java
浏览文件 @
4b83637b
...
...
@@ -54,7 +54,7 @@ public class Doclet {
String
className
=
getClass
(
clazz
.
name
());
FileWriter
out
=
new
FileWriter
(
fileName
);
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
out
));
int
validate
;
int
validate
Xhtml
;
// writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
// writer.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" /><title>");
writer
.
println
(
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
);
...
...
h2/src/tools/org/h2/tools/i18n/PrepareTranslation.java
浏览文件 @
4b83637b
...
...
@@ -35,7 +35,7 @@ public class PrepareTranslation {
// convert the txt files to properties files
PropertiesToUTF8
.
textUTF8ToProperties
(
"src/docsrc/text/_docs_de.utf8.txt"
,
"src/docsrc/text/_docs_de.properties"
);
//
PropertiesToUTF8.textUTF8ToProperties("src/docsrc/text/_docs_ja.utf8.txt", "src/docsrc/text/_docs_ja.properties");
PropertiesToUTF8
.
textUTF8ToProperties
(
"src/docsrc/text/_docs_ja.utf8.txt"
,
"src/docsrc/text/_docs_ja.properties"
);
// create the .jsp files and extract the text in the main language
extractFromHtml
(
"src/docsrc/html"
,
"src/docsrc/text"
,
MAIN_LANGUAGE
);
...
...
@@ -46,12 +46,12 @@ public class PrepareTranslation {
// create the translated documentation
buildHtml
(
"src/docsrc/text"
,
"docs/html"
,
"en"
);
buildHtml
(
"src/docsrc/text"
,
"docs/html"
,
"de"
);
//
buildHtml("src/docsrc/text", "docs/html", "ja");
buildHtml
(
"src/docsrc/text"
,
"docs/html"
,
"ja"
);
// convert the properies files back to utf8 text files, including the main lanuage (to be used as a template)
PropertiesToUTF8
.
propertiesToTextUTF8
(
"src/docsrc/text/_docs_en.properties"
,
"src/docsrc/text/_docs_en.utf8.txt"
);
PropertiesToUTF8
.
propertiesToTextUTF8
(
"src/docsrc/text/_docs_de.properties"
,
"src/docsrc/text/_docs_de.utf8.txt"
);
//
PropertiesToUTF8.propertiesToTextUTF8("src/docsrc/text/_docs_ja.properties", "src/docsrc/text/_docs_ja.utf8.txt");
PropertiesToUTF8
.
propertiesToTextUTF8
(
"src/docsrc/text/_docs_ja.properties"
,
"src/docsrc/text/_docs_ja.utf8.txt"
);
// delete temporary files
File
[]
list
=
new
File
(
"src/docsrc/text"
).
listFiles
();
...
...
@@ -73,8 +73,22 @@ public class PrepareTranslation {
throw
new
IOException
(
"Translation not found: "
+
propName
);
}
Properties
transProp
=
FileUtils
.
loadProperties
(
propName
);
// overload with this language
prop
.
putAll
(
transProp
);
for
(
Iterator
it
=
transProp
.
keySet
().
iterator
();
it
.
hasNext
();
)
{
String
key
=
(
String
)
it
.
next
();
String
t
=
transProp
.
getProperty
(
key
);
// overload with translations, but not the ones starting with #
if
(!
t
.
startsWith
(
"#"
))
{
prop
.
put
(
key
,
t
);
}
}
// add spaces to each token
for
(
Iterator
it
=
prop
.
keySet
().
iterator
();
it
.
hasNext
();
)
{
String
key
=
(
String
)
it
.
next
();
String
t
=
prop
.
getProperty
(
key
);
prop
.
put
(
key
,
" "
+
t
+
" "
);
}
ArrayList
fileNames
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
list
.
length
;
i
++)
{
String
name
=
list
[
i
].
getName
();
...
...
@@ -238,6 +252,7 @@ public class PrepareTranslation {
||
"span"
.
equals
(
name
))
{
// keep tags if wrapped, but not if this is the wrapper
if
(
buff
.
length
()
>
0
)
{
buff
.
append
(
' '
);
buff
.
append
(
parser
.
getToken
().
trim
());
ignoreEnd
=
false
;
}
else
{
...
...
@@ -279,6 +294,7 @@ public class PrepareTranslation {
}
else
{
if
(
buff
.
length
()
>
0
)
{
buff
.
append
(
parser
.
getToken
());
buff
.
append
(
' '
);
}
}
}
else
{
...
...
@@ -367,8 +383,7 @@ public class PrepareTranslation {
}
}
Properties
p
=
FileUtils
.
loadProperties
(
main
.
getAbsolutePath
());
Properties
base
=
FileUtils
.
loadProperties
(
baseDir
+
"/"
+
main
.
getName
());
Properties
base
=
FileUtils
.
loadProperties
(
baseDir
+
"/"
+
main
.
getName
());
PropertiesToUTF8
.
storeProperties
(
p
,
main
.
getAbsolutePath
());
for
(
int
i
=
0
;
i
<
translations
.
size
();
i
++)
{
File
trans
=
(
File
)
translations
.
get
(
i
);
...
...
@@ -380,31 +395,55 @@ public class PrepareTranslation {
private
static
void
prepare
(
Properties
main
,
Properties
base
,
File
trans
)
throws
IOException
{
Properties
p
=
FileUtils
.
loadProperties
(
trans
.
getAbsolutePath
());
Properties
oldTranslations
=
new
Properties
();
for
(
Iterator
it
=
base
.
keySet
().
iterator
();
it
.
hasNext
();
)
{
String
key
=
(
String
)
it
.
next
();
String
m
=
base
.
getProperty
(
key
);
String
t
=
p
.
getProperty
(
key
);
if
(!
t
.
startsWith
(
"#"
))
{
oldTranslations
.
setProperty
(
m
,
t
);
}
}
// add missing keys, using # and the value from the main file
Iterator
it
=
main
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
String
key
=
(
String
)
it
.
next
();
String
now
=
main
.
getProperty
(
key
);
if
(!
p
.
containsKey
(
key
))
{
System
.
out
.
println
(
trans
.
getName
()
+
": key "
+
key
+
" not found in translation file; added dummy # 'translation'"
);
p
.
put
(
key
,
"#"
+
now
);
String
t
=
oldTranslations
.
getProperty
(
now
);
if
(
t
==
null
)
{
System
.
out
.
println
(
trans
.
getName
()
+
": key "
+
key
+
" not found in translation file; added dummy # 'translation'"
);
t
=
"#"
+
now
;
}
p
.
put
(
key
,
t
);
}
else
{
String
t
=
p
.
getProperty
(
key
);
String
last
=
base
.
getProperty
(
key
);
if
(
last
!=
null
&&
!
last
.
equals
(
now
))
{
// main data changed since the last run: review translation
System
.
out
.
println
(
trans
.
getName
()
+
": key "
+
key
+
" changed; last="
+
last
+
" now="
+
now
);
String
old
=
p
.
getProperty
(
key
);
p
.
put
(
key
,
"#"
+
now
+
" #"
+
old
);
if
(
t
.
startsWith
(
"#"
))
{
// not translated before
t
=
oldTranslations
.
getProperty
(
now
);
if
(
t
==
null
)
{
t
=
"#"
+
now
;
}
p
.
put
(
key
,
t
);
}
else
if
(
last
!=
null
&&
!
last
.
equals
(
now
))
{
t
=
oldTranslations
.
getProperty
(
now
);
if
(
t
==
null
)
{
// main data changed since the last run: review translation
System
.
out
.
println
(
trans
.
getName
()
+
": key "
+
key
+
" changed, please review; last="
+
last
+
" now="
+
now
);
String
old
=
p
.
getProperty
(
key
);
t
=
"#"
+
now
+
" #"
+
old
;
}
p
.
put
(
key
,
t
);
}
}
}
// remove keys that don't exist in the main file (deleted or typo in the
// key)
// remove keys that don't exist in the main file (deleted or typo in the key)
it
=
new
ArrayList
(
p
.
keySet
()).
iterator
();
while
(
it
.
hasNext
())
{
String
key
=
(
String
)
it
.
next
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论