Skip to content

The Unified and Autonomous Development Platform

feat: Detecting malicious unicode in merge requests (OD-2434)

Robin Shena630e76201cf
diff --git a/pom.xml b/pom.xml
index 863fe445be..e13a8cebf1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -636,8 +636,8 @@
</repository>
</repositories>
<properties>
- <commons.version>3.0.11</commons.version>
- <agent.version>2.2.14</agent.version>
+ <commons.version>3.0.12</commons.version>
+ <agent.version>2.2.15</agent.version>
<slf4j.version>2.0.9</slf4j.version>
<logback.version>1.4.14</logback.version>
<antlr.version>4.7.2</antlr.version>
diff --git a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/BlobTextDiffPanel.java b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/BlobTextDiffPanel.java
index fd7721b886..2558976723 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/BlobTextDiffPanel.java
+++ b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/BlobTextDiffPanel.java
@@ -2,6 +2,7 @@ package io.onedev.server.web.component.diff.blob.text;
import static io.onedev.server.codequality.BlobTarget.groupByLine;
import static io.onedev.server.util.diff.DiffRenderer.toHtml;
+import static io.onedev.server.web.translation.Translation._T;
import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
import static org.unbescape.javascript.JavaScriptEscape.escapeJavaScript;
@@ -35,6 +36,7 @@ import org.unbescape.html.HtmlEscape;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Preconditions;
+import com.ibm.icu.text.SpoofChecker;
import io.onedev.commons.utils.LinearRange;
import io.onedev.commons.utils.StringUtils;
@@ -112,6 +114,8 @@ public class BlobTextDiffPanel extends Panel {
}
};
+
+ private static final SpoofChecker confusableChecker = new SpoofChecker.Builder().setChecks(SpoofChecker.CONFUSABLE).build();
private Component symbolTooltip;
@@ -499,16 +503,16 @@ public class BlobTextDiffPanel extends Panel {
for (int j=0; j<block.getElements().size(); j++) {
List<DiffBlock<String>> lineDiff = lineDiffs.get(j);
if (lineDiff != null)
- appendDelete(builder, block, j, lineDiff);
+ appendUnifiedDelete(builder, block, j, lineDiff);
else
- appendDelete(builder, block, j, null);
+ appendUnifiedDelete(builder, block, j, null);
}
for (int j=0; j<nextBlock.getElements().size(); j++) {
List<DiffBlock<String>> lineDiff = lineDiffs.get(j);
if (lineDiff != null)
- appendInsert(builder, nextBlock, j, lineDiff);
+ appendUnifiedInsert(builder, nextBlock, j, lineDiff);
else
- appendInsert(builder, nextBlock, j, null);
+ appendUnifiedInsert(builder, nextBlock, j, null);
}
} else {
int prevLineIndex = 0;
@@ -529,16 +533,28 @@ public class BlobTextDiffPanel extends Panel {
}
i++;
} else {
- for (int j=0; j<block.getElements().size(); j++)
- appendDelete(builder, block, j, null);
+ for (int j=0; j<block.getElements().size(); j++) {
+ if (diffMode == DiffViewMode.UNIFIED)
+ appendUnifiedDelete(builder, block, j, null);
+ else
+ appendSplitDelete(builder, block, j);
+ }
}
} else {
- for (int j=0; j<block.getElements().size(); j++)
- appendDelete(builder, block, j, null);
+ for (int j=0; j<block.getElements().size(); j++) {
+ if (diffMode == DiffViewMode.UNIFIED)
+ appendUnifiedDelete(builder, block, j, null);
+ else
+ appendSplitDelete(builder, block, j);
+ }
}
} else {
- for (int j=0; j<block.getElements().size(); j++)
- appendInsert(builder, block, j, null);
+ for (int j=0; j<block.getElements().size(); j++) {
+ if (diffMode == DiffViewMode.UNIFIED)
+ appendUnifiedInsert(builder, block, j, null);
+ else
+ appendSplitInsert(builder, block, j);
+ }
}
}
return builder.toString();
@@ -547,25 +563,18 @@ public class BlobTextDiffPanel extends Panel {
private void appendDeletesAndInserts(StringBuilder builder, DiffBlock<String> deleteBlock,
DiffBlock<String> insertBlock, int fromDeleteLineIndex, int toDeleteLineIndex,
int fromInsertLineIndex, int toInsertLineIndex) {
- if (diffMode == DiffViewMode.UNIFIED) {
- for (int i=fromDeleteLineIndex; i<toDeleteLineIndex; i++)
- appendDelete(builder, deleteBlock, i, null);
- for (int i=fromInsertLineIndex; i<toInsertLineIndex; i++)
- appendInsert(builder, insertBlock, i, null);
+ int deleteSize = toDeleteLineIndex - fromDeleteLineIndex;
+ int insertSize = toInsertLineIndex - fromInsertLineIndex;
+ if (deleteSize < insertSize) {
+ for (int i=fromDeleteLineIndex; i<toDeleteLineIndex; i++)
+ appendDeleteAndInsert(builder, deleteBlock, insertBlock, i, i-fromDeleteLineIndex+fromInsertLineIndex);
+ for (int i=fromInsertLineIndex+deleteSize; i<toInsertLineIndex; i++)
+ appendSplitInsert(builder, insertBlock, i);
} else {
- int deleteSize = toDeleteLineIndex - fromDeleteLineIndex;
- int insertSize = toInsertLineIndex - fromInsertLineIndex;
- if (deleteSize < insertSize) {
- for (int i=fromDeleteLineIndex; i<toDeleteLineIndex; i++)
- appendSideBySide(builder, deleteBlock, insertBlock, i, i-fromDeleteLineIndex+fromInsertLineIndex);
- for (int i=fromInsertLineIndex+deleteSize; i<toInsertLineIndex; i++)
- appendInsert(builder, insertBlock, i, null);
- } else {
- for (int i=fromInsertLineIndex; i<toInsertLineIndex; i++)
- appendSideBySide(builder, deleteBlock, insertBlock, i-fromInsertLineIndex+fromDeleteLineIndex, i);
- for (int i=fromDeleteLineIndex+insertSize; i<toDeleteLineIndex; i++)
- appendDelete(builder, deleteBlock, i, null);
- }
+ for (int i=fromInsertLineIndex; i<toInsertLineIndex; i++)
+ appendDeleteAndInsert(builder, deleteBlock, insertBlock, i-fromInsertLineIndex+fromDeleteLineIndex, i);
+ for (int i=fromDeleteLineIndex+insertSize; i<toDeleteLineIndex; i++)
+ appendSplitDelete(builder, deleteBlock, i);
}
}
@@ -703,101 +712,122 @@ public class BlobTextDiffPanel extends Panel {
builder.append("</tr>");
}
- private void appendInsert(StringBuilder builder, DiffBlock<String> block, int lineIndex,
+ private void appendSplitInsert(StringBuilder builder, DiffBlock<String> block, int lineIndex) {
+ builder.append("<tr class='code original'>");
+
+ int newLineNo = block.getNewStart() + lineIndex;
+ if (blameInfo != null) {
+ builder.append("<td class='blame noselect'>&nbsp;</td>");
+ }
+ builder.append("<td class='number noselect'><a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect'></td>");
+ builder.append("<td class='content left none'>&nbsp;</td>");
+ if (blameInfo != null) {
+ appendBlame(builder, -1, newLineNo);
+ }
+ builder.append("<td class='number noselect new'>").append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect new'>+</td>");
+ builder.append("<td class='content right new' data-new='").append(newLineNo).append("'>");
+ appendLine(builder, block.getElements().get(lineIndex));
+ builder.append("</td></tr>");
+ }
+
+ private void appendUnifiedInsert(StringBuilder builder, DiffBlock<String> block, int lineIndex,
@Nullable List<DiffBlock<String>> tokenDiffs) {
builder.append("<tr class='code original'>");
int newLineNo = block.getNewStart() + lineIndex;
- if (diffMode == DiffViewMode.UNIFIED) {
- if (blameInfo != null) {
- appendBlame(builder, -1, newLineNo);
+ if (blameInfo != null) {
+ appendBlame(builder, -1, newLineNo);
+ }
+ builder.append("<td class='number noselect new'><a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='number noselect new'>");
+ boolean confusable = false;
+ var oldLineBuilder = new StringBuilder();
+ var newLineBuilder = new StringBuilder();
+ if (tokenDiffs != null && !tokenDiffs.isEmpty()) {
+ for (DiffBlock<String> tokenBlock: tokenDiffs) {
+ for (String token: tokenBlock.getElements()) {
+ if (tokenBlock.getOperation() != Operation.DELETE || tokenBlock.getOperation() != Operation.EQUAL)
+ oldLineBuilder.append(token);
+ if (tokenBlock.getOperation() != Operation.INSERT || tokenBlock.getOperation() != Operation.EQUAL)
+ newLineBuilder.append(token);
+ }
+ confusable = isConfusable(oldLineBuilder.toString(), newLineBuilder.toString());
}
- builder.append("<td class='number noselect new'><a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='number noselect new'>").append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect new'>+</td>");
- builder.append("<td class='content new' data-new='").append(newLineNo).append("'>");
- if (tokenDiffs != null) {
- if (tokenDiffs.isEmpty()) {
- builder.append("&nbsp;");
- } else {
- for (DiffBlock<String> tokenBlock: tokenDiffs) {
- for (String token: tokenBlock.getElements()) {
- if (tokenBlock.getOperation() != Operation.DELETE)
- builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
- }
- }
- }
+ }
+ if (confusable)
+ builder.append(getConfusableMark());
+ builder.append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect new'>+</td>");
+ builder.append("<td class='content new' data-new='").append(newLineNo).append("'>");
+ if (tokenDiffs != null) {
+ if (tokenDiffs.isEmpty()) {
+ builder.append("&nbsp;");
} else {
- appendLine(builder, block.getElements().get(lineIndex));
- }
- builder.append("</td>");
+ for (DiffBlock<String> tokenBlock: tokenDiffs) {
+ for (String token: tokenBlock.getElements()) {
+ if (tokenBlock.getOperation() != Operation.DELETE)
+ builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
+ }
+ }
+ }
} else {
- if (blameInfo != null) {
- builder.append("<td class='blame noselect'>&nbsp;</td>");
- }
- builder.append("<td class='number noselect'><a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect'></td>");
- builder.append("<td class='content left none'>&nbsp;</td>");
- if (blameInfo != null) {
- appendBlame(builder, -1, newLineNo);
- }
- builder.append("<td class='number noselect new'>").append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect new'>+</td>");
- builder.append("<td class='content right new' data-new='").append(newLineNo).append("'>");
appendLine(builder, block.getElements().get(lineIndex));
- builder.append("</td>");
}
- builder.append("</tr>");
+ builder.append("</td></tr>");
+ }
+
+ private void appendSplitDelete(StringBuilder builder, DiffBlock<String> block, int lineIndex) {
+ builder.append("<tr class='code original'>");
+
+ int oldLineNo = block.getOldStart() + lineIndex;
+ if (blameInfo != null) {
+ appendBlame(builder, oldLineNo, -1);
+ }
+ builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect old'>-</td>");
+ builder.append("<td class='content left old' data-old='").append(oldLineNo).append("'>");
+ appendLine(builder, block.getElements().get(lineIndex));
+ builder.append("</td>");
+ if (blameInfo != null) {
+ builder.append("<td class='blame noselect'>&nbsp;</td>");
+ }
+ builder.append("<td class='number noselect'><a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect'>&nbsp;</td>");
+ builder.append("<td class='content right none'>&nbsp;</td></tr>");
}
- private void appendDelete(StringBuilder builder, DiffBlock<String> block, int lineIndex,
+ private void appendUnifiedDelete(StringBuilder builder, DiffBlock<String> block, int lineIndex,
@Nullable List<DiffBlock<String>> tokenDiffs) {
builder.append("<tr class='code original'>");
int oldLineNo = block.getOldStart() + lineIndex;
- if (diffMode == DiffViewMode.UNIFIED ) {
- if (blameInfo != null) {
- appendBlame(builder, oldLineNo, -1);
- }
- builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='number noselect old'><a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect old'>-</td>");
- builder.append("<td class='content old' data-old='").append(oldLineNo).append("'>");
- if (tokenDiffs != null) {
- if (tokenDiffs.isEmpty()) {
- builder.append("&nbsp;");
- } else {
- for (DiffBlock<String> tokenBlock: tokenDiffs) {
- for (String token: tokenBlock.getElements()) {
- if (tokenBlock.getOperation() != Operation.INSERT)
- builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
- }
+ if (blameInfo != null) {
+ appendBlame(builder, oldLineNo, -1);
+ }
+ builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='number noselect old'><a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect old'>-</td>");
+ builder.append("<td class='content old' data-old='").append(oldLineNo).append("'>");
+ if (tokenDiffs != null) {
+ if (tokenDiffs.isEmpty()) {
+ builder.append("&nbsp;");
+ } else {
+ for (DiffBlock<String> tokenBlock: tokenDiffs) {
+ for (String token: tokenBlock.getElements()) {
+ if (tokenBlock.getOperation() != Operation.INSERT)
+ builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
}
}
- } else {
- appendLine(builder, block.getElements().get(lineIndex));
}
- builder.append("</td>");
} else {
- if (blameInfo != null) {
- appendBlame(builder, oldLineNo, -1);
- }
- builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect old'>-</td>");
- builder.append("<td class='content left old' data-old='").append(oldLineNo).append("'>");
appendLine(builder, block.getElements().get(lineIndex));
- builder.append("</td>");
- if (blameInfo != null) {
- builder.append("<td class='blame noselect'>&nbsp;</td>");
- }
- builder.append("<td class='number noselect'><a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect'>&nbsp;</td>");
- builder.append("<td class='content right none'>&nbsp;</td>");
}
- builder.append("</tr>");
+ builder.append("</td></tr>");
}
-
- private void appendSideBySide(StringBuilder builder, DiffBlock<String> deleteBlock,
+
+ private void appendDeleteAndInsert(StringBuilder builder, DiffBlock<String> deleteBlock,
DiffBlock<String> insertBlock, int deleteLineIndex, int insertLineIndex) {
builder.append("<tr class='code original'>");
@@ -831,62 +861,46 @@ public class BlobTextDiffPanel extends Panel {
int oldLineNo = deleteBlock.getOldStart() + deleteLineIndex;
int newLineNo = insertBlock.getNewStart() + insertLineIndex;
- if (diffMode == DiffViewMode.UNIFIED) {
- if (blameInfo != null) {
- appendBlame(builder, oldLineNo, newLineNo);
- }
- builder.append("<td class='number noselect old new'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='number noselect old new'>").append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect old new'>*</td>");
- builder.append("<td class='content old new' data-old='").append(oldLineNo).append("' data-new='").append(newLineNo).append("'>");
- if (tokenDiffs.isEmpty()) {
- builder.append("&nbsp;");
- } else {
- for (DiffBlock<String> tokenBlock: tokenDiffs) {
- for (String token: tokenBlock.getElements())
+ if (blameInfo != null) {
+ appendBlame(builder, oldLineNo, -1);
+ }
+
+ builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect old'>-</td>");
+ builder.append("<td class='content left old' data-old='").append(oldLineNo).append("'>");
+
+ if (tokenDiffs.isEmpty()) {
+ builder.append("&nbsp;");
+ } else {
+ for (DiffBlock<String> tokenBlock: tokenDiffs) {
+ for (String token: tokenBlock.getElements()) {
+ if (tokenBlock.getOperation() != Operation.INSERT)
builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
}
}
- builder.append("</td>");
+ }
+ builder.append("</td>");
+
+ if (blameInfo != null) {
+ appendBlame(builder, -1, newLineNo);
+ }
+ builder.append("<td class='number noselect new'>");
+ if (isConfusable(deleteBlock.getElements().get(deleteLineIndex), insertBlock.getElements().get(insertLineIndex)))
+ builder.append(getConfusableMark());
+ builder.append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
+ builder.append("<td class='operation noselect new'>+</td>");
+ builder.append("<td class='content right new' data-new='").append(newLineNo).append("'>");
+ if (tokenDiffs.isEmpty()) {
+ builder.append("&nbsp;");
} else {
- if (blameInfo != null) {
- appendBlame(builder, oldLineNo, -1);
- }
- builder.append("<td class='number noselect old'>").append(oldLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect old'>-</td>");
- builder.append("<td class='content left old' data-old='").append(oldLineNo).append("'>");
- if (tokenDiffs.isEmpty()) {
- builder.append("&nbsp;");
- } else {
- for (DiffBlock<String> tokenBlock: tokenDiffs) {
- for (String token: tokenBlock.getElements()) {
- if (tokenBlock.getOperation() != Operation.INSERT)
- builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
- }
+ for (DiffBlock<String> tokenBlock: tokenDiffs) {
+ for (String token: tokenBlock.getElements()) {
+ if (tokenBlock.getOperation() != Operation.DELETE)
+ builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
}
}
- builder.append("</td>");
-
- if (blameInfo != null) {
- appendBlame(builder, -1, newLineNo);
- }
- builder.append("<td class='number noselect new'>").append(newLineNo+1).append("<a class='coverage'>&nbsp;</a></td>");
- builder.append("<td class='operation noselect new'>+</td>");
- builder.append("<td class='content right new' data-new='").append(newLineNo).append("'>");
- if (tokenDiffs.isEmpty()) {
- builder.append("&nbsp;");
- } else {
- for (DiffBlock<String> tokenBlock: tokenDiffs) {
- for (String token: tokenBlock.getElements()) {
- if (tokenBlock.getOperation() != Operation.DELETE)
- builder.append(toHtml(token, getOperationClass(tokenBlock.getOperation())));
- }
- }
- }
- builder.append("</td>");
- }
-
- builder.append("</tr>");
+ }
+ builder.append("</td></tr>");
}
private void appendExpander(StringBuilder builder, int blockIndex, int skippedLines) {
@@ -986,6 +1000,16 @@ public class BlobTextDiffPanel extends Panel {
public BlobAnnotationSupport getAnnotationSupport() {
return null;
}
+
+ private String getConfusableMark() {
+ return String.format(
+ "<a class='text-warning confusable' data-tippy-content='" + _T("This line has confusable unicode character modification") + "'><svg class='icon icon-sm'><use xlink:href='%s'/></svg></a>",
+ SpriteImage.getVersionedHref("warning-o"));
+ }
+
+ private boolean isConfusable(String text1, String text2) {
+ return confusableChecker.areConfusable(text1, text2) != 0;
+ }
private static class BlameInfo implements Serializable {
diff --git a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.css b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.css
index bf1695afc7..f067a66cab 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.css
+++ b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.css
@@ -11,6 +11,7 @@
border-left: 1px solid var(--light-gray);
text-align: right;
color: var(--gray);
+ white-space: nowrap;
}
.dark-mode .blob-text-diff>.text-diff>tbody>tr>td.number {
border-left-color: var(--dark-mode-lighter-dark);
@@ -107,6 +108,7 @@
padding-top: 0.1rem;
border-left: 1px solid var(--light-gray);
}
+
.dark-mode .blob-text-diff>.text-diff>tbody>tr>td.operation {
border-left-color: var(--dark-mode-lighter-dark);
}
@@ -174,7 +176,8 @@
}
.blob-text-diff>.text-diff>tbody>tr>td.number>.comment-indicator,
-.blob-text-diff>.text-diff>tbody>tr>td.number>.problem-trigger {
+.blob-text-diff>.text-diff>tbody>tr>td.number>.problem-trigger,
+.blob-text-diff>.text-diff>tbody>tr>td.number>.confusable {
margin-right: 0.3rem;
}
diff --git a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.js b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.js
index 76004dcd12..dc182bda9d 100644
--- a/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.js
+++ b/server-core/src/main/java/io/onedev/server/web/component/diff/blob/text/blob-text-diff.js
@@ -1115,8 +1115,11 @@ onedev.server.blobTextDiff = {
}).data("popoverInited", true);
}
});
-
- $lineNumTd.prepend($trigger);
+ var $confusable = $lineNumTd.children(".confusable");
+ if ($confusable.length != 0)
+ $confusable.after($trigger);
+ else
+ $lineNumTd.prepend($trigger);
},
addCoverateInfo: function($container, leftSide, line, coverageStatus) {
var $lineNumTd = onedev.server.blobTextDiff.getLineNumTd($container, leftSide, line);
diff --git a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh_CN.java b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh_CN.java
index f58b071712..e78cf6665a 100644
--- a/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh_CN.java
+++ b/server-core/src/main/java/io/onedev/server/web/translation/Translation_zh_CN.java
@@ -329,6 +329,7 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("Choose issue...", "选择工单...");
m.put("Choose iterations...", "选择迭代...");
m.put("Choose...", "选择...");
+ m.put("Click to show comment of marked text", "点击显示标记文本的评论");
m.put("Client ID of this OneDev instance registered in Google cloud", "在 Google Cloud 注册的本 OneDev 实例的客户端 ID");
m.put("Client Id", "客户端 ID");
m.put("Client Secret", "客户端密钥");
@@ -417,6 +418,7 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("Copy to clipboard", "复制到剪贴板");
m.put("Count", "数量");
m.put("Covered", "覆盖");
+ m.put("Covered by tests", "被测试覆盖");
m.put("Cppcheck Report", "Cppcheck 报告");
m.put("Cpu Limit", "CPU 限制");
m.put("Cpu Request", "CPU 请求");
@@ -444,6 +446,10 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("Cron schedule", "Cron 调度");
m.put("Curl Location", "Curl 路径");
m.put("Current Iteration", "当前迭代");
+ m.put("Current context is different from the context when this comment is added, click to show the comment context",
+ "当前上下文与添加此评论时的上下文不同,点击显示评论上下文");
+ m.put("Current context is different from the context when this reply is added, click to show the reply context",
+ "当前上下文与添加此回复时的上下文不同,点击显示回复上下文");
m.put("Current context is different from this action, click to show the comment context", "当前上下文与此操作不同,点击显示评论上下文");
m.put("Current platform", "当前平台");
m.put("Current project", "当前项目");
@@ -1174,6 +1180,7 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("Not Active Since", "不活跃起");
m.put("Not assigned", "未分配");
m.put("Not covered", "未覆盖");
+ m.put("Not covered by any test", "未被任何测试覆盖");
m.put("Not displaying any fields", "不显示任何字段");
m.put("Not displaying any links", "不显示任何链接");
m.put("Not passed", "未通过");
@@ -1501,6 +1508,7 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("Parent Project", "父项目");
m.put("Parents", "父项目");
m.put("Partially covered", "部分覆盖");
+ m.put("Partially covered by some tests", "部分被测试覆盖");
m.put("Passcode", "Passcode");
m.put("Passed", "通过");
m.put("Password", "密码");
@@ -2306,6 +2314,7 @@ public class Translation_zh_CN extends TranslationResourceBundle {
"确保发送到有效负载 URL 的 POST 请求来自 OneDev 的密钥。设置密钥后,您将在 Webhook POST 请求中收到 X-OneDev-Signature 头部");
m.put("Then enter the passcode shown in the TOTP authenticator to verify", "然后输入 TOTP 认证器中显示的验证码进行验证");
m.put("There are merge conflicts. You can still create the pull request though", "有合并冲突。您仍然可以创建合并请求");
+ m.put("There are unsaved changes, discard and continue?", "有未保存的更改,是否丢弃并继续?");
m.put("These authenticators normally run on your mobile phone, some examples are Google Authenticator, Microsoft Authenticator, Authy, 1Password etc.",
"这些认证器通常在您的手机上运行,例如 Google Authenticator、Microsoft Authenticator、Authy、1Password 等");
m.put("This <span wicket:id=\"elementTypeName\"></span> is imported from <a wicket:id=\"link\" class=\"alert-link\"><span wicket:id=\"label\"></span></a>",
@@ -2616,16 +2625,8 @@ public class Translation_zh_CN extends TranslationResourceBundle {
m.put("{0} edited {1}", "{0} 编辑于 {1}");
m.put("{0} files", "{0} 个文件");
m.put("{0} tags", "{0} 个标签");
- m.put("Click to show comment of marked text", "点击显示标记文本的评论");
- m.put("Covered by tests", "被测试覆盖");
- m.put("Current context is different from the context when this comment is added, click to show the comment context",
- "当前上下文与添加此评论时的上下文不同,点击显示评论上下文");
- m.put("Current context is different from the context when this reply is added, click to show the reply context",
- "当前上下文与添加此回复时的上下文不同,点击显示回复上下文");
- m.put("Not covered by any test", "未被任何测试覆盖");
- m.put("Partially covered by some tests", "部分被测试覆盖");
- m.put("There are unsaved changes, discard and continue?", "有未保存的更改,是否丢弃并继续?");
-
+ m.put("This line has confusable unicode character modification", "此行有可疑的 Unicode 字符修改");
+
// Manually added keys
m.put("Create Administrator Account", "创建管理员账户");
m.put("Server Setup", "服务器设置");