From 4290ea602abe224fa8efb571921539c27b321d37 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Sat, 17 Mar 2018 23:46:37 +0100 Subject: [PATCH] minor fix --- src/core/languages/gen.sh | 40 ++++++++++++++++++------------- src/core/languages/vi_VN.json | 12 ++++++++++ src/core/languages/vi_VN.json.old | 19 +++++++++++++-- 3 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/core/languages/gen.sh b/src/core/languages/gen.sh index caffd09..4332516 100755 --- a/src/core/languages/gen.sh +++ b/src/core/languages/gen.sh @@ -29,9 +29,10 @@ grep --include=\*.{coffee,tag} -roh "$1" -e '__("[^"]*"' | while read -r line ; echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json" fi 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 )) #echo $len + #echo $line SUBSTRING=${line:4:len} #echo $SUBSTRING if test -f "$2" && [ ! -z "$(grep -F "\"$SUBSTRING\":" "$2")" ] @@ -41,21 +42,26 @@ grep --include=\*.{coffee,html,tag} -roh "$1" -e '\"__\([^\"]*\)\"' | while read echo -e "\t\"$SUBSTRING\":\"$SUBSTRING\"," >> "tmp.json" fi done -sort tmp.json > tmp1.json -awk '!a[$0]++' "tmp1.json" > tmp.json -sed '$ s/.$//' tmp.json > tmp1.json -# remove duplicate entry -if test -f $2 +if test -f tmp.json then - cp $2 "$2.old" - sed '$ s/.$//' $2 > tmp.json - cat tmp.json > $2 - echo "," >> $2 - cat tmp1.json >> $2 - echo "}" >> "$2" + sort tmp.json > tmp1.json + awk '!a[$0]++' "tmp1.json" > tmp.json + sed '$ s/.$//' tmp.json > tmp1.json + # remove duplicate entry + if test -f $2 + then + cp $2 "$2.old" + sed '$ s/.$//' $2 > tmp.json + cat tmp.json > $2 + echo "," >> $2 + cat tmp1.json >> $2 + echo "}" >> "$2" + else + echo "{"> "$2" + cat tmp1.json >> "$2" + echo "}" >> "$2" + fi + rm tmp.json tmp1.json else - echo "{"> "$2" - cat tmp1.json >> "$2" - echo "}" >> "$2" -fi -rm tmp.json tmp1.json \ No newline at end of file + echo "Nothing change" +fi \ No newline at end of file diff --git a/src/core/languages/vi_VN.json b/src/core/languages/vi_VN.json index b0ff321..c946656 100644 --- a/src/core/languages/vi_VN.json +++ b/src/core/languages/vi_VN.json @@ -255,4 +255,16 @@ "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}" + +, + "Graph editor":"Graph editor", + "Render":"Render" } diff --git a/src/core/languages/vi_VN.json.old b/src/core/languages/vi_VN.json.old index 615f366..1c0405f 100644 --- a/src/core/languages/vi_VN.json.old +++ b/src/core/languages/vi_VN.json.old @@ -246,6 +246,21 @@ "Edit mount point":"Sửa điểm truy cập" , - "Services":"Services", - "Startup":"Startup" + "Services":"Dịch vụ", + "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}" }