From 9d8c78093410eba33e1e834817d2a9d0cefeebc1 Mon Sep 17 00:00:00 2001 From: "Yury V. Zaytsev" Date: Sat, 18 Nov 2017 19:33:50 +0100 Subject: [PATCH] maint: fix hint file processing Signed-off-by: Yury V. Zaytsev --- maint/utils/sync-transifex/mc.hint-fromTransifex.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/maint/utils/sync-transifex/mc.hint-fromTransifex.sh b/maint/utils/sync-transifex/mc.hint-fromTransifex.sh index df8ffb51d..2b8b2dd4d 100755 --- a/maint/utils/sync-transifex/mc.hint-fromTransifex.sh +++ b/maint/utils/sync-transifex/mc.hint-fromTransifex.sh @@ -33,8 +33,19 @@ source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions" #*** file scope functions ********************************************** -removeExtraBackSlash() { +processHintFiles() { + + # Remove extra backslash sed -i -e 's/\\-/-/g' ${MC_SOURCE_ROOT_DIR}/doc/hints/l10n/mc.hint.* + + # Remove extra line breaks + for fn in ${MC_SOURCE_ROOT_DIR}/doc/hints/l10n/mc.hint.*; do + awk '/^$/ { print "\n"; } /./ { printf("%s ", $0); } END { print; }' $fn > $fn.tmp + sed -e 's/[[:space:]]*$//' < $fn.tmp > $fn + perl -i -0pe 's/\n+\Z/\n/' $fn + rm $fn.tmp + done + } #*** main code ********************************************************* @@ -47,4 +58,4 @@ createPo4A "mc.hint" convertFromPoToText "${WORK_DIR}" "mc.hint" -removeExtraBackSlash +processHintFiles -- 2.11.4.GIT