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

Documentation: the grammar and function documentation can now be easier translated.

上级 48a2b4f5
......@@ -376,7 +376,7 @@ SET IGNORECASE { TRUE | FALSE }
If IGNORECASE is enabled, text columns in newly created tables will be
case-insensitive."
"Commands (Other)","SET LOG","
SET LOCK_MODE int
SET LOG int
","
Sets the transaction log mode."
"Commands (Other)","SET LOCK_MODE","
......@@ -819,39 +819,39 @@ The sample variance (square of the sample standard deviation)."
"Functions (Numeric)","ABS","
ABS ( { int | long | decimal | double } )
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","ACOS","
ACOS(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","ASIN","
ASIN(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","ATAN","
ATAN(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","COS","
COS(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","COT","
COT(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","SIN","
SIN(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","TAN","
TAN(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","ATAN2","
ATAN2(double, double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","BITAND","
BITAND(long, long)
","
......@@ -871,43 +871,43 @@ The modulo operation."
"Functions (Numeric)","CEILING","
CEILING(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","DEGREES","
DEGREES(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","EXP","
EXP(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","FLOOR","
FLOOR(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","LOG","
LOG(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","LOG10","
LOG10(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","RADIANS","
RADIANS(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","SQRT","
SQRT(double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","PI","
PI()
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","POWER","
POWER(double, double)
","
See also Java Math."
See also Java ""Math."
"Functions (Numeric)","RAND","
RAND( [ int ] )
","
......@@ -999,7 +999,7 @@ Converts a string to the hex representation."
"Functions (String)","INSTR","
INSTR(string, searchString, [, startInt])
","
Returns the location of a search string in a string (s)."
Returns the location of a search string in a string."
"Functions (String)","INSERT Function","
INSERT(originalString, startInt, lengthInt, addString)
","
......@@ -1091,7 +1091,7 @@ Decodes a byte array in the UTF8 format to a string."
"Functions (String)","XMLATTR","
XMLATTR(nameString, valueString)
","
Creates an XML attribute element of the form name=""value""."
Creates an XML attribute element of the form ""name=value""."
"Functions (String)","XMLNODE","
XMLNODE(elementString [, attributesString [, contentString]])
","
......@@ -1107,7 +1107,7 @@ Creates an XML CDATA element."
"Functions (String)","XMLSTARTDOC","
XMLSTARTDOC()
","
The string '<?xml version=""1."
The string ""<?xml version='1."
"Functions (String)","XMLTEXT","
XMLTEXT(valueString)
","
......
......@@ -151,6 +151,7 @@ public class GenerateDoc {
// text is enclosed in <p> .. </p> so this works.
text = StringUtils.replaceAll(text, "<br /><br />", "</p><p>");
text = StringUtils.replaceAll(text, "<br />", " ");
text = addCode(text);
map.put("text", text);
}
......@@ -174,4 +175,56 @@ public class GenerateDoc {
JdbcUtils.closeSilently(stat);
}
}
private String addCode(String text) {
text = StringUtils.replaceAll(text, "&quot;", "\"");
StringBuilder buff = new StringBuilder(text.length());
int len = text.length();
boolean code = false, codeQuoted = false;
for (int i = 0; i < len; i++) {
char c = text.charAt(i);
if (i < len - 1) {
char next = text.charAt(i+1);
if (!code && !codeQuoted) {
if (Character.isUpperCase(c) && Character.isUpperCase(next)) {
buff.append("<code>");
code = true;
} else if (c == '\"' && (i == 0 || text.charAt(i - 1) != '\\')) {
buff.append("<code>");
codeQuoted = true;
continue;
}
}
}
if (code) {
if (!Character.isLetterOrDigit(c) && "_.".indexOf(c) < 0) {
buff.append("</code>");
code = false;
}
} else if (codeQuoted && c == '\"') {
buff.append("</code>");
codeQuoted = false;
continue;
}
buff.append(c);
}
if (code) {
buff.append("</code>");
}
String s = buff.toString();
s = StringUtils.replaceAll(s, "</code>, <code>", ", ");
s = StringUtils.replaceAll(s, ".</code>", "</code>.");
s = StringUtils.replaceAll(s, ",</code>", "</code>.");
s = StringUtils.replaceAll(s, " @<code>", " <code>@");
s = StringUtils.replaceAll(s, "</code> <code>", " ");
s = StringUtils.replaceAll(s, "<code>SQL</code>", "SQL");
s = StringUtils.replaceAll(s, "<code>XML</code>", "XML");
s = StringUtils.replaceAll(s, "<code>URL</code>", "URL");
s = StringUtils.replaceAll(s, "<code>URLs</code>", "URLs");
s = StringUtils.replaceAll(s, "<code>HTML</code>", "HTML");
s = StringUtils.replaceAll(s, "<code>KB</code>", "KB");
s = StringUtils.replaceAll(s, "<code>MB</code>", "MB");
s = StringUtils.replaceAll(s, "<code>GB</code>", "GB");
return s;
}
}
......@@ -655,4 +655,4 @@ licensing appreciate textbook diligence undergraduate afaik mathematics chris
arrangements bugfix premain longs majority crashing behaving inst inventor
javaagent park accurately adopt consists night equally enhance enhanced
skiing honor marketing sleeping dlucene timezones shifted analyzed insists
train joining bilingual existed
train joining bilingual existed extremely fog
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论