gettextpoeditphp-gettext

poedit fails with "Updating the catalog failed"


I am using gettext for a large PHP project. I have successfully setup everything, entered a few translations (in two languages) to test if translations work and started coding. From time to time I even updated the translations using poEdit.

Now, for no apparent reason, I am getting this error in poEdit when I try to update catalog from sources:

Updating the catalog failed. Click on 'More>>' for details.

When I click Details >>, I get detailed message:

08:52:19: Entries in the catalog are probably incorrect.
08:52:19: Updating the catalog failed. Click on 'More>>' for details.

Following advice on Internet I tried changing paths (base path and project paths), but to no avail (nothing changes). Note that it does not say anything about not finding sources - just that it failed. I have also validated both .po files:

msgfmt -o /dev/null -v -c messages.po

I am running poEdit 1.4.2-5 (on Debian).

Any ideas how I could get a detailed error info? (or get rid of the problem? ;)


Solution

  • I finally solved the issue by running:

    find /path/to/project/ -name '*.php' -exec xgettext --from-code=UTF-8 -o messages.pot '{}' ';'
    

    Then I fixed the error messages (permission denied to read a subdirectory) and everything works again. Hope it helps someone.