From 4ec2bdbd0c3ea1b0eff4fe317c337a8d4e0277b1 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Wed, 8 May 2019 10:55:05 +0200 Subject: [PATCH] Fix newline when converting back modules by using printf instead of echo. fix #9 --- rollback_module.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rollback_module.sh b/rollback_module.sh index 9e16e1f..f9f0b37 100755 --- a/rollback_module.sh +++ b/rollback_module.sh @@ -43,10 +43,8 @@ function extract_translation { msgid="$(awk 'NR{printf "%s",$0;next;}1' <<< ${tempMsgid})" # Escape special char causing problem in with sed and xml - msgstr=${msgstr//'\n'/'\\n'} msgstr=${msgstr//'\"'/"""} msgstr=${msgstr//'&'/'\&'} - msgid=${msgid//'\n'/'\\n'} msgid=${msgid//'\"'/"""} msgid=${msgid//'&'/'\&'} @@ -57,7 +55,8 @@ function extract_translation { translation=${msgstr} fi - echo ${translation} + # Using printf is more consistent then echo, here it transforms \n in real newline 😄 + printf "${translation}" } function rebuild_txt {