Merge pull request #11870 from lujun9972/status

使用一条正则表达式整合新旧模板的翻译判断
This commit is contained in:
Xingyu.Wang 2019-01-02 20:49:25 +08:00 committed by GitHub
commit 7c62e0b0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,13 +5,7 @@ cd "$(dirname "$0")/../.." # 进入TP root
function file-translating-p ()
{
local file="$*"
if head -n 1 "${file}" |grep '\[^#\]:'>/dev/null 2>&1 ;then
# 新模板
head -n 12 "$file" |grep -v '\[^#\]:' |grep -E -i "translat|fanyi|翻译" >/dev/null 2>&1
else
# 旧模板
head -n 3 "$file" |grep -E -i "translat|fanyi|翻译" >/dev/null 2>&1
fi
head -n 3 "$file" | grep -iE "^[^[].*translat|^\[#\]: translator: \([^[:space:]]+\)|fanyi|翻译" >/dev/null 2>&1
}
function get_status_of()
{