Re: [PATCH] C style: use standard style for "TRANSLATORS" comments
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 11, 2017, 21:41 UTC
- Message-ID
- <20170511214125.GB21723@aiede.svl.corp.google.com>
- In-Reply-To
- <20170511212012.6782-1-avarab@gmail.com>
Hi,
Ævar Arnfjörð Bjarmason wrote:
> 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.
Hooray!
[...]
Show 5 quoted lines
> --- a/Documentation/CodingGuidelines > +++ b/Documentation/CodingGuidelines > @@ -256,12 +256,12 @@ For C programs: > > Note however that a comment that explains a translatable string to
The "Note however" isn't needed since it's not contradicting the previous point any more. This can be an entirely separate item:
- A comment that explains a translatable string to translators uses a convention of starting with a magic token "TRANSLATORS: " [etc]
It might even make sense to remove the explanation of TRANSLATORS comments from this file altogether, since they're intuitive to use. A more common place to want to learn about them is po/README, which already explains them.
[...]
Show 12 quoted lines
> --- a/bisect.c
> +++ b/bisect.c
> @@ -995,8 +995,10 @@ int bisect_next_all(const char *prefix, int no_checkout)
>
> steps_msg = xstrfmt(Q_("(roughly %d step)", "(roughly %d steps)",
> steps), steps);
> - /* TRANSLATORS: the last %s will be replaced with
> - "(roughly %d steps)" translation */
> + /*
> + * TRANSLATORS: the last %s will be replaced with "(roughly %d
> + * steps)" translation.
> + */Nice.
[...]
Show 11 quoted lines
> +++ b/ref-filter.c
> @@ -1251,13 +1251,17 @@ char *get_head_description(void)
> state.branch);
> else if (state.detached_from) {
> if (state.detached_at)
> - /* TRANSLATORS: make sure this matches
> - "HEAD detached at " in wt-status.c */
> + /*
> + * TRANSLATORS: make sure this matches "HEAD
> + * detached at " in wt-status.c
> + */optional: could treat "HEAD detached at " as an unbreakable phrase for the sake of line-breaking, for easier grepping.
But what's here is also perfectly fine.
[...]
Show 6 quoted lines
> - /* TRANSLATORS: make sure this matches > - "HEAD detached from " in wt-status.c */ > + /* > + * TRANSLATORS: make sure this matches "HEAD > + * detached from " in wt-status.c > + */
Likewise.
The rest also look good. This is great.
Thanks, Jonathan