【问题标题】:po translation files: what are automatic comments for?po 翻译文件:自动注释有什么用?
【发布时间】:2023-03-12 21:17:01
【问题描述】:

当我翻译一些东西时,有时会有一些字符串放在 cmets 中并放在其他所有内容之后。这些 cmets 是干什么用的?

例如:

#~ msgid ""
#~ "You tried to register but your email is already known.\n"
#~ "To try again to login, click on the following link:\n"
#~ "{}{}"
#~ msgstr ""
#~ "Vous avez essayé de vous enregistrer, mais votre email est déjà connu."
#~ "Pour vous connecter, cliquez sur le lien suivant :\n"
#~ "{}{}"

~ 有什么用? 有时会有这样的管道:

#~| msgid "Show your activity"
#~ msgid "your activities"
#~ msgstr "Montrer mon activité"

| 有什么用?

【问题讨论】:

    标签: translation po


    【解决方案1】:

    #~ cmets 是 过时 字符串。当一个字符串有翻译但没有出现在当前模板(.pot)中时,msgmerge 工具会用#~ 将其注释掉,但保留它。

    如果该字符串将来再次出现,它将再次取消注释翻译,因此您不必重新翻译它。它还将使用因此评论的条目作为通过模糊匹配提出建议的来源。


    #~| 是注释掉 #| 评论的结果。 #| 评论是通过模糊匹配创建建议时的原始文本。例如,如果目录有

    msgid "Open"
    msgstr "Otevři"
    

    模板有

    msgid "Open!"
    msgstr ""
    

    然后msgmerge 将创建:

    #,fuzzy
    #| msgid "Open"
    msgid "Open!"
    msgstr "Otevři"
    

    poedit、pootle 或 weblate 等 po 编辑器应在字符串修复和模糊标志删除时删除 #| 注释。但如果有人在文本编辑器中编辑.po,他们可能会错误地将其留在其中。

    【讨论】:

      猜你喜欢
      • 2012-04-30
      • 2017-11-02
      • 1970-01-01
      • 1970-01-01
      • 2015-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-13
      相关资源
      最近更新 更多