[PATCH 0 of 9 ] prevent translation for some rst syntax

Martin Geisler martin at geisler.net
Sat Feb 8 05:17:31 CST 2014

Simon Heimberg <simohe at besonet.ch> writes:

> In the past, rst syntax has been translated several times. Improve the
> situation by two concepts. Translation files do not contain entries
> containing noting but directives (rst syntax: ..XXX::) and
> untranslatable arguments. And remind the translator by writing a note
> before paragraphs with directives.

Great stuff! If we try to move to the long

  .. note::

     This is the note.

syntax, then the translators will be almost completely shielded from the
rst syntax.

This made me think of something else: would it make sense to strip
leading whitespace when generating hg.pot? I'm thinking of turning
source like this (from 'hg help add'):

    If no names are given, add all files to the repository.

    .. container:: verbose

       An example showing how new (unknown) files are added
       automatically by :hg:`add`::

into msgids like

  msgid "If no names are given, add all files to the repository."
  msgstr ""

  msgid ""
  "An example showing how new (unknown) files are added\n"
  "automatically by :hg:`add`::"
  msgstr ""

I think we could still lookup the right text at translation time by
stripping leading whitespace, do the lookup, and then adding it
afterwards -- this is actually just like how we split paragraphs.

The advantage would be that translators seen even less rst syntax and
wont have to deal with keeping the indentation consistent.

Martin Geisler

http://google.com/+MartinGeisler | http://careers.stackoverflow.com/mg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140208/12862155/attachment.pgp>

More information about the Mercurial-devel mailing list