minor fix

This commit is contained in:
Xuan Sang LE 2018-03-17 23:46:37 +01:00
parent a111162e7b
commit 4290ea602a
3 changed files with 52 additions and 19 deletions

View File

@ -29,9 +29,10 @@ grep --include=\*.{coffee,tag} -roh "$1" -e '__("[^"]*"' | while read -r line ;
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json" echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
fi fi
done done
grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__\([^\"]*\)\"' | while read -r line; do grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__([^\"]*)\"' | while read -r line; do
len=$(( ${#line} - 6 )) len=$(( ${#line} - 6 ))
#echo $len #echo $len
#echo $line
SUBSTRING=${line:4:len} SUBSTRING=${line:4:len}
#echo $SUBSTRING #echo $SUBSTRING
if test -f "$2" && [ ! -z "$(grep -F "\"$SUBSTRING\":" "$2")" ] if test -f "$2" && [ ! -z "$(grep -F "\"$SUBSTRING\":" "$2")" ]
@ -41,6 +42,8 @@ grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__\([^\"]*\)\"' | while read
echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json" echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json"
fi fi
done done
if test -f tmp.json
then
sort tmp.json > tmp1.json sort tmp.json > tmp1.json
awk '!a[$0]++' "tmp1.json" > tmp.json awk '!a[$0]++' "tmp1.json" > tmp.json
sed '$ s/.$//' tmp.json > tmp1.json sed '$ s/.$//' tmp.json > tmp1.json
@ -59,3 +62,6 @@ else
echo "}" >> "$2" echo "}" >> "$2"
fi fi
rm tmp.json tmp1.json rm tmp.json tmp1.json
else
echo "Nothing change"
fi

View File

@ -255,4 +255,16 @@
"Please select an entry":"Vui lòng chọn 1 mục từ danh sách", "Please select an entry":"Vui lòng chọn 1 mục từ danh sách",
"Startup applications":"Ứng dụng khởi chạy", "Startup applications":"Ứng dụng khởi chạy",
"Startup services":"Dịch vụ khởi chạy" "Startup services":"Dịch vụ khởi chạy"
,
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export: {0}":"Cannot export: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Syntax error: {0}":"Syntax error: {0}"
,
"Graph editor":"Graph editor",
"Render":"Render"
} }

View File

@ -246,6 +246,21 @@
"Edit mount point":"Sửa điểm truy cập" "Edit mount point":"Sửa điểm truy cập"
, ,
"Services":"Services", "Services":"Dịch vụ",
"Startup":"Startup" "Startup":"Khởi chạy"
,
"Add application":"Thêm ứng dụng",
"Add service":"Thêm dịch vụ",
"Please select an entry":"Vui lòng chọn 1 mục từ danh sách",
"Startup applications":"Ứng dụng khởi chạy",
"Startup services":"Dịch vụ khởi chạy"
,
"Cannot export to PNG in this browser: {0}":"Cannot export to PNG in this browser: {0}",
"Cannot export to {0}: {1}":"Cannot export to {0}: {1}",
"Cannot export: {0}":"Cannot export: {0}",
"Export as":"Export as",
"File exported":"File exported",
"Syntax error: {0}":"Syntax error: {0}"
} }