From 43308d7643910ef2c9947b4216b8d7d36d8aa6d0 Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 16 Mar 2022 20:12:24 +0000 Subject: [PATCH] Issue 2716 - part 1: Update the translation scripts to meet the new requirement Signed-off-by: linggao --- tools/copy-i18n-messages | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/copy-i18n-messages b/tools/copy-i18n-messages index a71f8b231..ca69d1479 100755 --- a/tools/copy-i18n-messages +++ b/tools/copy-i18n-messages @@ -1,13 +1,10 @@ #!/bin/bash -# this command copies the out.gotext.json files from locales and cli/locales to i18n_translation directory +# copy the out.gotext.json files from locales and cli/locales to i18n_translation directory cp $PKGPATH/locales/en/out.gotext.json $PKGPATH/i18n_translation/original/anax.out.gotext.json.auto - -# remove unnecessary fields and add NLS_CHARSET=UTF-8 comments for translation process -cat $PKGPATH/i18n_translation/original/anax.out.gotext.json.auto | jq 'del(.messages[].placeholders)| del(.messages[].id) | del(.messages[].translatorComment) | del(.messages[].fuzzy) ' | sed 's/"message":/"id":/g' | sed '1 i // NLS_CHARSET=UTF-8' > $PKGPATH/i18n_translation/anax.out.gotext.json - cp $PKGPATH/cli/locales/en/out.gotext.json $PKGPATH/i18n_translation/original/hzn.out.gotext.json.auto -# remove unnecessary fields and add NLS_CHARSET=UTF-8 comments for translation process -cat $PKGPATH/i18n_translation/original/hzn.out.gotext.json.auto | jq 'del(.messages[].placeholders)| del(.messages[].id) | del(.messages[].translatorComment) | del(.messages[].fuzzy) ' | sed 's/"message":/"id":/g' | sed '1 i // NLS_CHARSET=UTF-8' > $PKGPATH/i18n_translation/hzn.out.gotext.json +# remove unnecessary fields for translation process +cat $PKGPATH/i18n_translation/original/anax.out.gotext.json.auto | jq '.messages | del(.[].placeholders) | del(.[].id) | del(.[].translatorComment) | del(.[].fuzzy) ' | sed 's/"message":/"id":/g' > $PKGPATH/i18n_translation/anax.out.gotext.json +cat $PKGPATH/i18n_translation/original/hzn.out.gotext.json.auto | jq '.messages | del(.[].placeholders) | del(.[].id) | del(.[].translatorComment) | del(.[].fuzzy) ' | sed 's/"message":/"id":/g' > $PKGPATH/i18n_translation/hzn.out.gotext.json