How to add a new string to a *.po file w/ a PO editor

pirhac picture pirhac · Oct 6, 2011 · Viewed 47.4k times · Source

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

msgid "greeting"
msgstr "Hello World"

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.

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.)

Answer

Ignacio Vazquez-Abrams picture Ignacio Vazquez-Abrams · Oct 7, 2011

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