Skip to content

Commit

Permalink
Merge pull request #3078 from linggao/issue2716
Browse files Browse the repository at this point in the history
Issue 2716 - part 1: Update the translation scripts to meet the new r…
  • Loading branch information
linggao committed Mar 16, 2022
2 parents 1ca0d33 + 43308d7 commit f6fc9f1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/copy-i18n-messages
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f6fc9f1

Please sign in to comment.