This commit is contained in:
heckflosse 2019-03-31 23:31:44 +02:00
commit db65d11aa1

View File

@ -15,7 +15,6 @@
# #
# Locale files are generated automatically: # Locale files are generated automatically:
# - English (UK) # - English (UK)
# - Polish (Latin Characters)
tmp=temp_file tmp=temp_file
if [[ -w $tmp ]]; then if [[ -w $tmp ]]; then
@ -30,14 +29,22 @@ abort () {
trap 'abort' HUP INT QUIT ABRT TERM trap 'abort' HUP INT QUIT ABRT TERM
cd "rtdata/languages" || { printf "%s\n" "You must run this script from the root of the project."; exit 1; } cd "rtdata/languages" || { printf "%s\n" "You must run this script from the root of the project."; exit 1; }
# Build array of all interface translation files, or use user-specified ones only # Build array of all interface translation files, or use user-specified ones only
unset langFiles unset langFiles
if [[ $# = 0 ]]; then if [[ $# = 0 ]]; then
while read -r; do while read -r; do
langFiles+=("$REPLY") 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)" | sort) 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 else
langFiles=("$@") langFiles=("$@")
for langFile in "${langFiles[@]}"; do for langFile in "${langFiles[@]}"; do
@ -117,8 +124,10 @@ case "${langFiles[@]}" in
sed 'y/ĄĆĘŁŃÓŚŹŻąćęłńóśźż/ACELNOSZZacelnoszz/' < Polish > "Polish (Latin Characters)" sed 'y/ĄĆĘŁŃÓŚŹŻąćęłńóśźż/ACELNOSZZacelnoszz/' < Polish > "Polish (Latin Characters)"
;;& ;;&
esac esac
ttot2="$(date +%s)" ttot2="$(date +%s)"
ttot=$((ttot2-ttot1)) ttot=$((ttot2-ttot1))
tsec=$((ttot%60)) tsec=$((ttot%60))
tmin=$((ttot/60)) tmin=$((ttot/60))
printf "%s\n" "Finished updating ${#langFiles[@]} files." "Total time: ${tmin}m ${tsec}s" printf "%s\n" "Finished updating ${#langFiles[@]} files." "Total time: ${tmin}m ${tsec}s"