Skip to content

Commit c7d7935

Browse files
committed
zhconv: only translated in old should be kept
or msgcat won't go through..
1 parent 303fe51 commit c7d7935

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

zhconv-merge.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ usage="Usage: $0 OLD_FILE MERGE_ME_IN [POT_FILE=MERGE_ME_IN]
77
Env vars:
88
ZH_MSGMERGE_OPTS \`linear' array of extra flags for \`msgmerge'.
99
Example: '-E -C \"my compendia.po\" -w 79 --previous'
10-
Default: '--backup=nil --previous'
10+
Default: '--previous'
1111
1212
ZH_POST_OCC:function What to do after invoking OpenCC. To use,
1313
define a function with this name in bash,
@@ -34,7 +34,7 @@ $usage"
3434
type opencc sed msgmerge >/dev/null || die "required command(s) not found"
3535

3636
# Accept environment 'linear array' input.
37-
declare -a ZH_MSGMERGE_OPTS="(${ZH_MSGMERGE_OPTS:---backup=nil --previous})"
37+
declare -a ZH_MSGMERGE_OPTS="(${ZH_MSGMERGE_OPTS:---previous})"
3838

3939
type ZH_POST_OCC &>/dev/null || ZH_POST_OCC(){ :; }
4040

@@ -155,7 +155,10 @@ occ_conv "$newtype" "$oldtype" "$new"{,".$oldtype"} ||
155155

156156
ZH_POST_OCC
157157

158+
cp "$old"{,'~'}
159+
msgattrib --translated -o "$old"{,}
158160
msgcat -o "$old.all" --use-first "$old" "$new.$oldtype"
161+
159162
msgmerge --lang="zh_$oldtype" "${ZH_MSGMERGE_OPTS[@]}" -o "$old"{,.all} "$pot" ||
160163
die "msgmerge returned $?."
161164

0 commit comments

Comments
 (0)