Added timing and sorting in tools/generateTranslationDiffs
This commit is contained in:
@@ -35,9 +35,9 @@ cd "rtdata/languages" || { printf "%s\n" "You must run this script from the root
|
||||
# Build array of all interface translation files, or use user-specified ones only
|
||||
unset langFiles
|
||||
if [[ $# = 0 ]]; then
|
||||
while read -r -d $'\0'; do
|
||||
while read -r; do
|
||||
langFiles+=("$REPLY")
|
||||
done < <(find . -not -iname "default" -not -iname "LICENSE" -not -iname "README" -not -iname "*.sh" -not -iname ".*" -not -iname "$tmp" -not -iname "English (UK)" -not -iname "Polish (Latin Characters)" -print0)
|
||||
done < <(find . -not -iname "default" -not -iname "LICENSE" -not -iname "README" -not -iname "*.sh" -not -iname ".*" -not -iname "$tmp" -not -iname "English (UK)" -not -iname "Polish (Latin Characters)" | sort)
|
||||
else
|
||||
langFiles=("$@")
|
||||
for langFile in "${langFiles[@]}"; do
|
||||
@@ -66,11 +66,13 @@ getComments default > "$tmp"
|
||||
getChanged default >> "$tmp"
|
||||
mv "$tmp" "default"
|
||||
|
||||
i=1
|
||||
printf "%s\n" "Digging through ${#langFiles[@]} file(s). This may take a while."
|
||||
ttot1="$(date +%s)"
|
||||
for file in "${langFiles[@]}"; do
|
||||
t1="$(date +%s)"
|
||||
printf "%s" "Processing $file"
|
||||
printf "%02d - ${file#.*/}" "$i"
|
||||
dos2unix "$file" 2>/dev/null
|
||||
# printf "%s\n" "Searching $file for changed strings"
|
||||
unset trLines newLines
|
||||
# Fill trLines with translated text
|
||||
trLines+=("$(getChanged "$file")")
|
||||
@@ -97,6 +99,7 @@ for file in "${langFiles[@]}"; do
|
||||
t2="$(date +%s)"
|
||||
tt=$((t2-t1))
|
||||
printf "%s\n" " - took $tt seconds"
|
||||
((i++))
|
||||
done
|
||||
|
||||
case "${langFiles[@]}" in
|
||||
@@ -113,3 +116,8 @@ case "${langFiles[@]}" in
|
||||
sed 'y/ĄĆĘŁŃÓŚŹŻąćęłńóśźż/ACELNOSZZacelnoszz/' < Polish > "Polish (Latin Characters)"
|
||||
;;&
|
||||
esac
|
||||
ttot2="$(date +%s)"
|
||||
ttot=$((ttot2-ttot1))
|
||||
tsec=$((ttot%60))
|
||||
tmin=$((ttot/60))
|
||||
printf "%s\n" "Finished updating ${#langFiles[@]} files." "Total time: ${tmin}m ${tsec}s"
|
||||
|
Reference in New Issue
Block a user