Why ".po files are actually .pot"?


I have been experimenting with pontoon for a few days (and liking it a lot!).

While trying to sync a newly created project (using a heroku deployment), I came accross this error:

Skipping resource locales/en/messages.po due to ParseError: Failed to parse ***/locales/en/messages.pot: Syntax error in po file None (line 1)

Looking in the code, I found out that method source_to_locale_path (github link) adds this final t to matched resources (here locales/en/messages.po).
The method docstring says : “.po files are actually .pot”.

This is the first time I work with i18n and am not much aware of how things work, however this is quite misleading to me :

  • I understand .pot files are (more or less) .po templates, not really .po files : what is meant in the docstring then ? What am I missing?
  • I use js-lingui for internationalization, which is .po based only (cannot generate .pot) : is there a way to make it work with pontoon without changing the code?
  • If I remove this method, the synchronization works and I can see my messages on the web app : am I breaking something important?

Many thanks!

Hi @kadd!

Files in your source repository should have .pot extension, whereas localizable files should use .po.

See for example the l10n repo of the MDN project:

You’ll find .pot files in the templates folder and their .po counterparts in each locale folder. That’s a specific of Gettext and Pontoon has to follow it.

Hello @mathjazz,

Got it, all clear.

For the record, I am commenting out these 2 lines in method source_to_locale_path, this is enough to have the whole workflow working (except possibly machineries, but not sure this is related) with js-lingui (and probably other libs that do not use/provide .pot extraction).

Thank you for the clarification.

1 Like