Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 785
pirhac Avatar asked Oct 06 '11 20:10

pirhac


People also ask

How do I edit a .po file?

To edit PO files, you could use any (advanced) text editor (such as Sublime Text or Notepad++), any IDE software (such as VisualStudio Code and others), or just use Localazy, which was made specifically with translation file formats in mind.

How do you edit in Poedit?

Ctrl + F the original text that you want to change. Change it, and then save it. Then open the file with po edit again, and you will see the changed text.

What is .po file type?

A . PO file is a portable object file, which is text-based. These types of files are used in commonly in software development. The . PO file may be referenced by Java programs, GNU gettext, or other software programs as a properties file.

What is a .MO file Poedit?

MO files are standard translation and language files, the Poedit software automatically lists the original string along with the translation. Note how the above document appears as it should, not jumbled or scrambled. To edit a string, simply click once to select the string + translation.


1 Answers

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

like image 64
Ignacio Vazquez-Abrams Avatar answered Sep 28 '22 07:09

Ignacio Vazquez-Abrams