From 4469e172827d0114c3bdefe102f52f3954d7b02a Mon Sep 17 00:00:00 2001 From: Wenxuan Zhao Date: Thu, 6 Dec 2018 04:57:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BB=95=E8=BF=87=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=EF=BC=9A=E4=B8=80=E6=AC=A1=E5=8F=AA=E5=85=81=E8=AE=B8=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E4=B8=80=E7=AF=87=E8=AF=91=E6=96=87=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check/identify.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/check/identify.sh b/scripts/check/identify.sh index 51a501517f..4d2d5e060f 100644 --- a/scripts/check/identify.sh +++ b/scripts/check/identify.sh @@ -47,20 +47,20 @@ rule_translation_completed() { && [ "$TOTAL" -eq 2 ] && echo "匹配规则:提交译文" } -# 校对译文:只能校对一篇 +# 校对译文:只能校对一篇译文 rule_translation_revised() { [ "$TSL_M" -eq 1 ] \ && check_category TSL M \ && [ "$TOTAL" -eq 1 ] && echo "匹配规则:校对译文" } -# 发布译文:发布多篇译文 +# 发布译文:只能发布一篇译文 rule_translation_published() { - [ "$TSL_D" -ge 1 ] && [ "$PUB_A" -ge 1 ] && [ "$TSL_D" -eq "$PUB_A" ] \ - && ensure_identical SRC D TSL A 1 \ + [ "$TSL_D" -eq 1 ] && [ "$PUB_A" -eq 1 ] \ + && ensure_identical TSL D PUB A 1 \ && check_category TSL D \ && [ "$TOTAL" -eq $((TSL_D + PUB_A)) ] \ - && echo "匹配规则:发布译文 ${PUB_A} 篇" + && echo "匹配规则:发布译文" } # 定义常见错误 From 1987e5d99cf11b871745e1759ad2857c7b1fa738 Mon Sep 17 00:00:00 2001 From: Wenxuan Zhao Date: Thu, 6 Dec 2018 05:04:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=95=E8=BF=87=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=A7=84=E5=88=99=20=E2=80=94?= =?UTF-8?q?=E2=80=94=20=E6=A0=A1=E5=AF=B9=E5=B7=B2=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check/identify.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/check/identify.sh b/scripts/check/identify.sh index 4d2d5e060f..10073706d5 100644 --- a/scripts/check/identify.sh +++ b/scripts/check/identify.sh @@ -63,6 +63,12 @@ rule_translation_published() { && echo "匹配规则:发布译文" } +# 校对已发布译文:只能校对一篇已发布的译文 +rule_published_translation_revised() { + [ "$PUB_M" -eq 1 ] \ + && [ "$TOTAL" -eq 1 ] && echo "匹配规则:校对已发布译文" +} + # 定义常见错误 # 未知错误 @@ -84,6 +90,7 @@ do_check() { || rule_translation_completed \ || rule_translation_revised \ || rule_translation_published \ + || rule_published_translation_revised \ || { error_translation_requested_multiple \ || error_undefined From a141ee87fb664e174aca38327b7ae34a06940cae Mon Sep 17 00:00:00 2001 From: Wenxuan Zhao Date: Thu, 6 Dec 2018 05:08:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=95=E8=BF=87=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=EF=BC=9A=E6=B7=BB=E5=8A=A0=E9=94=99=E8=AF=AF=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=20=E2=80=94=E2=80=94=20=E4=B8=8D=E5=85=81=E8=AE=B8=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E6=8F=90=E4=BA=A4=E5=A4=9A=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/check/identify.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/check/identify.sh b/scripts/check/identify.sh index 10073706d5..f0a0ad58fa 100644 --- a/scripts/check/identify.sh +++ b/scripts/check/identify.sh @@ -79,7 +79,13 @@ error_undefined() { # 申领多篇 error_translation_requested_multiple() { [ "$SRC_M" -gt 1 ] \ - && echo "匹配错误:申领多篇,请一次仅申领一篇" + && echo "匹配错误:请勿申领多篇,请一次仅申领一篇" +} + +# 提交多篇 +error_translation_completed_multiple() { + [ "$TSL_A" -gt 1 ] \ + && echo "匹配错误:请勿提交多篇,请一次仅提交一篇" } # 执行检查并输出匹配项目 @@ -93,6 +99,7 @@ do_check() { || rule_published_translation_revised \ || { error_translation_requested_multiple \ + || error_translation_completed_multiple \ || error_undefined exit 1 }