如何使用PO编辑器将新字符串添加到* .po文件 [英] How to add a new string to a *.po file w/ a PO editor

查看:250
本文介绍了如何使用PO编辑器将新字符串添加到* .po文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我手动创建了一个文件:test.po,内容如下:

I MANUALLY created a file: test.po with the contents:

msgid打招呼"
msgstr"Hello World"

msgid "greeting"
msgstr "Hello World"

现在,我可以在"poedit"和"GTranslated"(我正在使用Ubuntu)之类的编辑器中编辑翻译(世界).我什至可以在该翻译中添加评论.但是,"poedit"和"GTranslated"都不会让我添加一个新的翻译字符串-我在网上没有用,也没有看过其他编辑器的屏幕截图,而且似乎都没有"new"按钮.

Now I can edit the translation (hello world) in editors like "poedit" and "GTranslated" (I'm using Ubuntu). I can even add comments to that translation. However neither "poedit" and "GTranslated" will let me ADD a new translation string - I've looked online to no avail and looked at screenshots of other editors and none seem to have a "new" button.

我想念什么???必须使用普通"文本编辑器编辑新键,然后在这些PO编辑器中编辑它们(无论是哪个),这似乎很愚蠢. (如果您无法确定我是这个"gettext"世界的新手,那么我将在Zend/PHP中建立一个网站.)

What am I missing??? It seems stupid to have to edit new keys w/ a "plain" text editor and then edit them in these PO editors (whichever they may be). (If you can't tell I'm new to this 'gettext' world - I'm building a website in Zend/PHP.)

推荐答案

永远不要将字符串直接添加到.po文件中;它们将从xgettext生成的.pot文件中msgmerge添加. > .

You should never be adding strings directly to a .po file; they will be added by msgmerge from the .pot file generated by xgettext.

这篇关于如何使用PO编辑器将新字符串添加到* .po文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆