We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"#!/bin/慶典
USERLANG="" # 默認語言代碼,當文件名中沒有時。 STAMP="false" # 是否適配 PO-Revision-Date 字段。
[ -n "$USERLANG" ] || { echo "首先編輯腳本並設置 USERLANG。"; 出口 1;}
[ "$1" == "--now" -o "$1" == "-n" ] && { STAMP="true"; 轉移; }
[ "$1" == "--help" -o "$1" == "-h" -o -z "$1" ] && { echo " 用法:$0 [--now|-n] POFILE
選項 --now 或 -n 將 PO-Revision-Date 設置為當前日期和時間。
POFILE 可以是 <package_name>-..po 或 <package_name>-.po. "; 退出 1; }
[ -z "$2" ] || { echo "參數太多。"; 出口 1;}
文件=“$1”
[ -f "$文件"] || { echo "沒有這樣的文件:$file"; 出口 1;}
[ "${file##*.}" == "po" ] || { echo "參數不是 *.po 文件。"; 出口 1;}
msgfmt --檢查$文件|| { echo "先修復錯誤。"; 出口 1;}
名稱=${文件##/} base=${name%.po} 裸=${base%.[[:alpha:]_]} lang=${base##*.}
[ "$bare" == "$base" ] && { lang=$USERLANG; name=$bare.$lang.po; }
project=$(sed -n -e '/^"項目-Id-版本:/{ s/.: ([Gg][Nn][Uu] )(.)\n"/\2/ s/ /-/克 p;q;}' $文件) [ "$name" != "$project.$lang.po" ] && { echo "Project-Id-Version '${project/-/ }' 與文件名不匹配。" 出口 1; }
[ "$郵票" == "真"] && { # 將修訂日期設置為此時此刻。 NEWFIELD="採購訂單修訂日期:$(日期 +"%F %R%z")"; sed -i'' -e "s/^"PO-修訂日期:.*"$/"$NEWFIELD\\n"/" $file; }
gzip <$文件 | uuencode -m $名稱.gz | mail -s "TP-robot $name" [email protected] " https://translationproject.org/extra/sendpo.sh#:~:text=%23!/bin/%E6%85%B6%E5%85%B8,robot%40translationproject.org
The text was updated successfully, but these errors were encountered:
No branches or pull requests
"#!/bin/慶典
將給定文件發送到 TP 機器人的腳本。
USERLANG="" # 默認語言代碼,當文件名中沒有時。
STAMP="false" # 是否適配 PO-Revision-Date 字段。
[ -n "$USERLANG" ] || { echo "首先編輯腳本並設置 USERLANG。"; 出口 1;}
[ "$1" == "--now" -o "$1" == "-n" ] && { STAMP="true"; 轉移; }
[ "$1" == "--help" -o "$1" == "-h" -o -z "$1" ] && { echo "
用法:$0 [--now|-n] POFILE
選項 --now 或 -n 將 PO-Revision-Date 設置為當前日期和時間。
POFILE 可以是 <package_name>-..po
或 <package_name>-.po.
"; 退出 1; }
[ -z "$2" ] || { echo "參數太多。"; 出口 1;}
文件=“$1”
[ -f "$文件"] || { echo "沒有這樣的文件:$file"; 出口 1;}
[ "${file##*.}" == "po" ] || { echo "參數不是 *.po 文件。"; 出口 1;}
msgfmt --檢查$文件|| { echo "先修復錯誤。"; 出口 1;}
名稱=${文件##/}
base=${name%.po}
裸=${base%.[[:alpha:]_]}
lang=${base##*.}
filename不包含默認語言代碼時填寫。
[ "$bare" == "$base" ] && { lang=$USERLANG; name=$bare.$lang.po; }
將 Project-Id-Version 與文件名進行比較。
project=$(sed -n -e '/^"項目-Id-版本:/{
s/.: ([Gg][Nn][Uu] )(.)\n"/\2/
s/ /-/克
p;q;}' $文件)
[ "$name" != "$project.$lang.po" ] && {
echo "Project-Id-Version '${project/-/ }' 與文件名不匹配。"
出口 1;
}
[ "$郵票" == "真"] && {
# 將修訂日期設置為此時此刻。
NEWFIELD="採購訂單修訂日期:$(日期 +"%F %R%z")";
sed -i'' -e "s/^"PO-修訂日期:.*"$/"$NEWFIELD\\n"/" $file;
}
將壓縮的 PO 文件發送給 TP 機器人。
gzip <$文件 | uuencode -m $名稱.gz |
mail -s "TP-robot $name" [email protected]
"
https://translationproject.org/extra/sendpo.sh#:~:text=%23!/bin/%E6%85%B6%E5%85%B8,robot%40translationproject.org
The text was updated successfully, but these errors were encountered: