0

这是我的代码的一小段:

#SUBTRACTION
       elif _("sub") in calc: #FOR TRANSLATORS: This is a translated if statement. Dont add accents. Use a key part of the word e.g. sub instead of subtract instead of the full word if possible.
           misc.showUserWhatIThink(_("subtract a number from a number"))
           TheBasics.subtraction()

Poedit (gettext) 会将评论分配FOR TRANSLATORS: This is a translated if statement. [...]subtract a number from a number而不是sub. 我希望“子”的评论出现在“翻译注释”部分。

有什么办法可以规避这种情况吗?我已经一遍又一遍地添加了相同的评论;我不想重做这一切。

4

1 回答 1

0

这不可能。

而且由于需要对提取器逻辑进行重大更改以使评论放置更加灵活,因此这种情况不太可能发生变化。

如果它对您来说是关键任务:使用一个小脚本预解析您的源代码,如果您找到#TRANSLATORS注释,请将它们提取到_().

于 2021-03-09T14:55:58.230 回答