The final script (gettext_order.sh) to extract the strings from the empty.po file and re-organise it in an alphabetical order is here:
#!/usr/bin/bash
cat empty.po | while read -r line
do
if [[ ${line:0:1} == "#" ]]
then
echo "${line}" | sed -e 's/\\/\//g' # 116.94 secs
# echo "${line}" | tr '\\' '/' # 118.61 secs
else
echo -E "${line}"
fi
done > empty_ordered.po;
I have added in the "fuzzy" line and the "Report Bugs to" line as well and ordered all the strings and attached it herein, Compared with yours too and strings are all okay except for some #references out of order.
The timer script for efficiency checks is:
#!/bin/sh
# This should be at the top of the script to get the start time of the script
start=$(date +%s.%N)
# Here you can place your function
sh $1
# bc not there in Git Bash
# duration=$(echo "$(date +%s.%N) - $start" | bc)
fin=$(date +%s.%N)
duration=$(awk '{print $1-$2}' <<<"${fin} ${start}")
execution_time=`printf "%.2f seconds" $duration`
echo "Script $1 Execution Time: $execution_time"
# Usage: timer gettext_order.sh
Place the timer script in C:\Program Files\Git\mingw64\bin folder for windows users as there is no "bc" command in the minimal bash in Windows Git and an "awk" workaround is substituted and used for testing any script.