我有一个 PO 文件,其内容如下:
msgid "or"
msgstr "or-translation"
msgid "orand"
msgstr "orand-translation"
我需要获取给定 msgid 的翻译。使用命令“msggrep -K -e 'orand' template2.pot”我得到了“orand”的翻译,这没关系。
但是当我使用“msggrep -K -e 'or' template2.pot”时,如果返回翻译('or'和'orand')。命令“msggrep -K -e '^or' template2.pot”按预期工作,返回两个翻译,但“msggrep -K -e '^or$' template2.pot”只是失败,因为它什么都不返回。似乎 '$' 字符会破坏 msggrep 正则表达式解析器。
我尝试过使用其他 msggrep 标志(如 -F、-E...),但它们都从文件中读取测试模式,这对于我的实际需求是不可接受的。我正在使用 msggrep 0.14.6(我无法更新到更新的库)。
有人知道如何使用 msggrep 获得“orand”的翻译吗?