diff options
author | bigbear <ns@bigbear.dk> | 2024-02-08 19:52:52 +0100 |
---|---|---|
committer | bigbear <ns@bigbear.dk> | 2024-02-08 19:52:52 +0100 |
commit | 9a05f56e1bf36abab41d12f92f2c75266c44bd4a (patch) | |
tree | f9ac600d137939dd484732515363a2337bdc6535 /po | |
parent | 0f5dea06fa62062c7e98b36945a63aae7835a80a (diff) |
Clean - HARDINFO2 BASE
Diffstat (limited to 'po')
-rw-r--r-- | po/HOWTO.txt | 9 | ||||
-rw-r--r-- | po/salvage.sh | 83 | ||||
-rwxr-xr-x[-rw-r--r--] | po/updatepo.sh | 2 |
3 files changed, 1 insertions, 93 deletions
diff --git a/po/HOWTO.txt b/po/HOWTO.txt deleted file mode 100644 index afe9a8c2..00000000 --- a/po/HOWTO.txt +++ /dev/null @@ -1,9 +0,0 @@ -Translators -=========== - -IF POSSIBLE, run `bash updatepo.sh` in the po/ directory before begining. -This will regenerate hardinfo.pot and update all the .po files. -NOTHING IS LOST if this isn't done, but it prevents wasting time translating -strings that have changed, or are no longer used. - -DO NOT use `make pot`! diff --git a/po/salvage.sh b/po/salvage.sh deleted file mode 100644 index 295187f4..00000000 --- a/po/salvage.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!bash - -# To help with https://github.com/lpereira/hardinfo/issues/100 -# Saves the old label translations. -# -# This is not an automated magical tool, it is an ugly hack of a helper -# for a tedious process. Read the instructions if you want to use it! -# -# bash updatepo.sh -# { commit here or the next commit's diff will be noisy and useless } -# -# { repeat for each language... } -# bash salvage.sh XX.po >XX.po.salv -# { edit XX.po.salv, remove nonsense } -# msgcat --use-first XX.po XX.po.salv > XX.po.merged -# diff XX.po XX.po.merged -# { if there are any added translations, they do not actually appear -# in hardinfo.pot, and they will end up "obsolete" and then re-processed -# in the next salvage. So save some hassle and just remove them now. } -# mv XX.po.merged XX.po -# -# { when all languages are done run updatepo.sh again to clean up } -# bash updatepo.sh -# - -if [ -z "$@" ]; then - echo "READ script before running!" - echo "Error: Needs .po file to process" - exit 1 -fi - -do_salvage() { - msgid=() - msgstr=() - - while IFS= read -r line; do - msgid+=( "$line" ) - done <<< "$MSGEXEC_MSGID" - - while IFS= read -r line; do - msgstr+=( "$line" ) - done <&0 - - for i in ${!msgid[@]}; do - # column titles - msgid[$i]=`echo "${msgid[$i]}" | sed -e 's/ColumnTitle\$.*=//'` - msgstr[$i]=`echo "${msgstr[$i]}" | sed -e 's/ColumnTitle\$.*=//'` - - # section titles - msgid[$i]=`echo "${msgid[$i]}" | sed -e 's/\[\(.*\)\]/\1/'` - msgstr[$i]=`echo "${msgstr[$i]}" | sed -e 's/\[\(.*\)\]/\1/'` - - # regular labels - msgid[$i]=`echo "${msgid[$i]}" | sed -e 's/=.*$//'` - msgstr[$i]=`echo "${msgstr[$i]}" | sed -e 's/=.*$//'` - - # junk - msgid[$i]=`echo "${msgid[$i]}" | sed -e 's/%s//'` - msgid[$i]=`echo "${msgid[$i]}" | sed -e 's/%s//'` - - if [[ -n "${msgid[$i]}" && -n "${msgstr[$i]}" ]]; then - if [ "${msgid[$i]}" != "${msgstr[$i]}" ]; then - echo "msgid \"${msgid[$i]}\"" - echo "msgstr \"${msgstr[$i]}\"" - echo "" - fi - fi - done -} - -cat >salvage.tmp <<'EOT' - -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -EOT - -export -f do_salvage -msgattrib --only-obsolete "$@" | msgexec bash -c 'do_salvage "$0"' >>salvage.tmp -msguniq salvage.tmp -rm salvage.tmp diff --git a/po/updatepo.sh b/po/updatepo.sh index e746902f..84e6ef7c 100644..100755 --- a/po/updatepo.sh +++ b/po/updatepo.sh @@ -1,4 +1,4 @@ -#!bash +#!/bin/bash GITVER=`git describe --always --dirty` GITHASH=`git rev-parse HEAD` |