Skip to content
  • Ævar Arnfjörð Bjarmason's avatar
    C style: use standard style for "TRANSLATORS" comments · 66f5f6dc
    Ævar Arnfjörð Bjarmason authored and Junio C Hamano's avatar Junio C Hamano committed
    Change all the "TRANSLATORS: [...]" comments in the C code to use the
    regular Git coding style, and amend the style guide so that the
    example there uses that style.
    
    This custom style was necessary back in 2010 when the gettext support
    was initially added, and was subsequently documented in commit
    cbcfd4e3 ("i18n: mention "TRANSLATORS:" marker in
    Documentation/CodingGuidelines", 2014-04-18).
    
    GNU xgettext hasn't had the parsing limitation that necessitated this
    exception for almost 3 years. Since its 0.19 release on 2014-06-02
    it's been able to recognize TRANSLATOR comments in the standard Git
    comment syntax[1].
    
    Usually we'd like to keep compatibility with software that's that
    young, but in this case literally the only person who needs to be
    using a gettext newer than 3 years old is Jiang Xin (the only person
    who runs & commits "make pot" results), so I think in this case we can
    make an exception.
    
    This xgettext parsing feature was added after a thread on the Git
    mailing list[2] which continued on the bug-gettext[3] list, but we
    never subsequently changed our style & styleguide, do so.
    
    There are already longstanding changes in git that use the standard
    comment style & have their TRANSLATORS comments extracted properly
    without getting the literal "*"'s mixed up in the text, as would
    happen before xgettext 0.19.
    
    Commit 7ff26832 ("builtin-am: implement -i/--interactive",
    2015-08-04) added one such comment, which in commit df0617bf ("l10n:
    git.pot: v2.6.0 round 1 (123 new, 41 removed)", 2015-09-05) got picked
    up in the po/git.pot file with the right format, showing that Jiang
    already runs a modern xgettext.
    
    The xgettext parser does not handle the sort of non-standard comment
    style that I'm amending here in sequencer.c, but that isn't standard
    Git comment syntax anyway. With this change to sequencer.c & "make
    pot" the comment in the pot file is now correct:
    
         #. TRANSLATORS: %s will be "revert", "cherry-pick" or
        -#. * "rebase -i".
        +#. "rebase -i".
    
    1. http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=10af7fe6bd
    2. <2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com>
       (https://public-inbox.org/git/2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com/)
    3. https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00016.html
    
    
    
    Signed-off-by: default avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
    Acked-by: default avatarJiang Xin <worldhello.net@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    66f5f6dc