Mercurial > p > roundup > code
comparison doc/developers.txt @ 7818:a44c5da250fa
doc: add specifcation of minimal header required for .po files
The team working on the classhelper web component found that roundup
crashed if the file was missing a requred conent-type preamble.
Document the minimal preamble to prevent crashing.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 20 Mar 2024 12:06:46 -0400 |
| parents | 161a92d1fb71 |
| children | a363bb8c0ed4 |
comparison
equal
deleted
inserted
replaced
| 7817:161a92d1fb71 | 7818:a44c5da250fa |
|---|---|
| 539 ``locale`` subdirectory of the tracker home directory. Translated | 539 ``locale`` subdirectory of the tracker home directory. Translated |
| 540 messages may be put in *locale*.po files (where *locale* is selected | 540 messages may be put in *locale*.po files (where *locale* is selected |
| 541 locale name) in the same directory, e.g.: ``locale/ru.po``. | 541 locale name) in the same directory, e.g.: ``locale/ru.po``. |
| 542 These message catalogs are searched prior to system-wide translations | 542 These message catalogs are searched prior to system-wide translations |
| 543 kept in the ``share`` directory. | 543 kept in the ``share`` directory. |
| 544 | |
| 545 If you are creating your own ``.po`` file from scratch rather than | |
| 546 using ``roundup-gettext``, you must have the minimal preamble | |
| 547 specifying the format of the file. This:: | |
| 548 | |
| 549 msgid "" | |
| 550 msgstr "" | |
| 551 "Content-Type: text/plain; charset=UTF-8\n" | |
| 552 | |
| 553 should be present as the first translatable string in your .po file. | |
| 554 If you use ``roundup-gettext`` it will add a full preamble including | |
| 555 ``Content-Type``. If the preamble is missing, using characters outside | |
| 556 of the ASCII range will cause Roundup to crash with a | |
| 557 UnicodeDecodeError. | |
| 544 | 558 |
| 545 Translating Messages | 559 Translating Messages |
| 546 ^^^^^^^^^^^^^^^^^^^^ | 560 ^^^^^^^^^^^^^^^^^^^^ |
| 547 | 561 |
| 548 Gettext Message File (`PO`_ file) is a plain text file, that can be created | 562 Gettext Message File (`PO`_ file) is a plain text file, that can be created |
