翻译 PO 文件
我们正在开发 PHP 中的 Web 应用程序,并使用 gettext 来处理字符串以进行翻译。这是我的问题,我们现在正在挣扎什么。
如果我们对字符串使用某种单词/id,例如“菜单功能”,并且我们希望将其用英语显示为“我们的主要功能”,我们当然可以做到,例如第一个英语翻译将由有权访问应用程序的人。这样我们就准备好了“EN”po 文件。 但是,如果我们想将其发送给其他译者,例如挪威语译者,那么这个人将再次只看到我们的“ID”。他/她如何通过该 ID 准确找到我们的想法?
我们是否对使用 PO 文件有不好的想法?有什么好的方法可以正确地做到这一点吗?
We are working on web application in PHP and use gettext to handle strings for translation. Here is my question what we are struggling right now.
If we use kind of words/id for a string for example "menu-feature" and we would like to display it in English as "Our main Features" we can do it of course and for example first English translation will be made by a person with access to application. So than we will have "EN" po file ready.
But if we would like to send it to other translator for example Norwegian so this person will see again only our "IDs". How he/she can find what we had in mind exactly with that ID ??
Do we have bad way of thinking about using PO files? Is a some good way to make it correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
常见的做法是使用默认语言中的整个实际字符串作为 msgid,其原因正是您所列出的:翻译人员将很难弄清楚每个占位符背后的含义。
也就是说,您可以向每个 id 添加注释作为翻译人员的提示。我认为这些行在 .po 文件中以 # 开头。他们还应该出现在 Poedit、Virtaal 或他们正在使用的任何东西中。
Common practice is to use the whole actual string in the default language as the msgid, for exactly the reason you've lined out: translators would have a much harder time figuring out the meaning behind each of your placeholders.
That said, you can add comments to each of the ids as a hint for translators. I think those lines start with a # in the .po file. They should also show up in Poedit, Virtaal or whatever they're using.
我已经有一段时间没有使用 poedit 了,但是为什么不直接复制英文文件,将其命名为挪威语,然后将其导入到 poedit 中并开始编辑呢?
I haven't used poedit in a while, but why don't you just copy the English file, call it Norwegian, import it in poedit and start editing?