From 3678c975311ec9826f7a2b506ba7fbd76aec6f3b Mon Sep 17 00:00:00 2001 From: Barry Jackson Date: Sun, 29 Jan 2023 11:40:02 +0000 Subject: fix typo and str quoting --- mk-pot | 12 ++++++------ po/remove-old-kernels.pot | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mk-pot b/mk-pot index 674b283..9c7087d 100755 --- a/mk-pot +++ b/mk-pot @@ -19,24 +19,24 @@ isdupe=1 done # Dupe not found so increment line index and add string to check array ((x++)) - rawarray[$x]="$1" + rawarray[x]="$1" return $isdupe } # Main script starts here rawarray=(); x=0 ; y=0 -# Get raw i18n strings (max two per script line) +# Get raw i18n strings while IFS='' read -r line; do if echo "$line"|grep -q '(i18n'; then # Look for up to 4 occurrences of "$(i18n" in one script line and extract raw text for each for ((i=2;i<5;i++)); do idstr="$(echo "$line"|grep i18n|sed "s/\$(i18n/@/g"|cut -d@ -f${i}|cut -d\" -f2| sed 's/").*//')" - if [[ ${#idstr} > 0 ]]; then + if (( ${#idstr} > 0 )); then # Check it is not dupe if ! chk_dupe "$idstr"; then # Output line IFS='' - echo -e "msgid \""$idstr"\"\nmsgstr \"\"\n" >> $outpot + echo -e "msgid \"""$idstr""\"\nmsgstr \"\"\n" >> $outpot fi else break @@ -53,6 +53,6 @@ sed -i "s/POT-Creation-Date: /&$(date '+%F %R%z')/" $outpot # Update po files with any string changes from the pot file echo "Updating *.po files with any string changes" -pushd po +pushd po || exit 1 make update-po -popd +popd || exit 1 diff --git a/po/remove-old-kernels.pot b/po/remove-old-kernels.pot index ac043ce..7e45d24 100644 --- a/po/remove-old-kernels.pot +++ b/po/remove-old-kernels.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: remove-old-kernels\n" "Report-Msgid-Bugs-To: \n" - "POT-Creation-Date: 2023-01-24 19:10+0000\n" + "POT-Creation-Date: 2023-01-29 11:37+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- cgit v1.2.1