Mercurial > p > roundup > code
changeset 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 | 0fe2b9f6e19f |
| files | doc/developers.txt |
| diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/developers.txt Wed Mar 20 11:47:04 2024 -0400 +++ b/doc/developers.txt Wed Mar 20 12:06:46 2024 -0400 @@ -542,6 +542,20 @@ These message catalogs are searched prior to system-wide translations kept in the ``share`` directory. +If you are creating your own ``.po`` file from scratch rather than +using ``roundup-gettext``, you must have the minimal preamble +specifying the format of the file. This:: + + msgid "" + msgstr "" + "Content-Type: text/plain; charset=UTF-8\n" + +should be present as the first translatable string in your .po file. +If you use ``roundup-gettext`` it will add a full preamble including +``Content-Type``. If the preamble is missing, using characters outside +of the ASCII range will cause Roundup to crash with a +UnicodeDecodeError. + Translating Messages ^^^^^^^^^^^^^^^^^^^^
