Closed dallascao closed 1 year ago
I replaced :
with :
and it fixed the problem.
Thanks for reporting this. In the 1st and 2nd examples, trans
used to interpret parameters 有效期:一年
and Non:
wrongly as source/target language codes, and that's why it failed to translate them as texts. Should be fixed now.
As for your 3rd example: because '{=zh+ja}'
is a valid pair of target language codes (that overrides the previous parameter en:zh-cn
), trans
awaits standard input to translate. This is the expected behavior and not considered a bug.
Plus, if you want to translate strings like "{=zh+ja}
" no matter what, separate it with parameters using a double-dash --
:
./trans en:zh-cn -- '{=zh+ja}'
./trans -b -no-bidi zh-CN:en '有效期:一年'
This will stuck and no translations will be returned.
Note: Not only Chinese. This won't work either:
./trans -b -no-bidi en:zh-cn 'Non:'
Update: This will also halt the program:
./trans en:zh-cn '{=zh+ja}'