Skip to content

Commit 9488053

Browse files
committed
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.
1 parent 19598ac commit 9488053

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/developers.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,20 @@ locale name) in the same directory, e.g.: ``locale/ru.po``.
542542
These message catalogs are searched prior to system-wide translations
543543
kept in the ``share`` directory.
544544

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.
558+
545559
Translating Messages
546560
^^^^^^^^^^^^^^^^^^^^
547561

0 commit comments

Comments
 (0)