3

I would like to have the following process flow:

  1. The programmer marks some entries in the source code as translatable
  2. The programmer generates a template file (.pot if I understood it correctly)
  3. The translator uses the template file to translate the strings. He never has to get any part of the code.

If a new string is added or an old string gets updated, a new template is generated and the translator can "update" his old translation. He should only need to review / translate the changed / new strings. The programmer should not have to do this updating-work.

At the moment I use poEdit and its updating function. I guess this entry in the .po-file gives poEdit the needed information:

"X-Poedit-Basepath: /var/www/community-chess\n"

But this makes it necessary to have to complete, latest source code. This means, the programmer has to do the first step of updating.

If I understood it correct, .pot-files are templates for .po-files. Is this just an empty (hence with no translated strings) .po-file? How can I create a .pot-file for a PHP-project on a Linux machine?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958

1 Answers1

0

Once you have i18n'd your source, you can run xgettext against it in order to extract all translatable strings into a .pot file.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • I tried xgettext that way: `xgettext -D /var/www/community-chess/ login.wrapper.php `. As far as I know, I have to specify a single file. Only giving it the directory doesn't work. Additionaly it gives my a .po file which irritates me. This is the reason why I wanted to know if there is a difference in the file structure of .po and .pot. – Martin Thoma Oct 08 '11 at 03:35
  • No there is no structural difference between a PO and a POT file. The POT is just an untranslated PO file that you use as a template. In the workflow you want you would use xgettext as suggested and translators would update their PO files against POT. – Dwayne Apr 07 '13 at 11:56