Fixed script lang-add.sh (adding texts with spaces at end)
This commit is contained in:
parent
9ad453bb2b
commit
851ac07941
|
|
@ -34,7 +34,7 @@ insert_xx()
|
||||||
#replace '[' and ']' in string with '\[' and '\]'
|
#replace '[' and ']' in string with '\[' and '\]'
|
||||||
str=$(echo "$1" | sed "s/\[/\\\[/g;s/\]/\\\]/g")
|
str=$(echo "$1" | sed "s/\[/\\\[/g;s/\]/\\\]/g")
|
||||||
# extract english texts, merge new text, grep line number
|
# extract english texts, merge new text, grep line number
|
||||||
ln=$((cat lang_en_$2.txt; echo $1) | sed "/^$/d;/^#/d" | sed -n 'p;n' | sort | grep -n "$str" | sed "s/:.*//")
|
ln=$((cat lang_en_$2.txt; echo "$1") | sed "/^$/d;/^#/d" | sed -n 'p;n' | sort | grep -n "$str" | sed "s/:.*//")
|
||||||
# calculate position for insertion
|
# calculate position for insertion
|
||||||
ln=$((4*(ln-2)+1))
|
ln=$((4*(ln-2)+1))
|
||||||
# insert new text
|
# insert new text
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue