Re: [PATCH v8 05/37] hook: teach hook.runHookDir
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 12, 2021, 08:33 UTC
- Message-ID
- <87im5whitx.fsf@evledraar.gmail.com>
- In-Reply-To
- <20210311021037.3001235-6-emilyshaffer@google.com>
On Thu, Mar 11 2021, Emily Shaffer wrote:
> + switch (should_run_hookdir) {
> + case HOOKDIR_NO:Style: case shouldn't be indented
Show 20 quoted lines
> + strbuf_addstr(&hookdir_annotation, _(" (will not run)"));
> + break;
> + case HOOKDIR_ERROR:
> + strbuf_addstr(&hookdir_annotation, _(" (will error and not run)"));
> + break;
> + case HOOKDIR_INTERACTIVE:
> + strbuf_addstr(&hookdir_annotation, _(" (will prompt)"));
> + break;
> + case HOOKDIR_WARN:
> + strbuf_addstr(&hookdir_annotation, _(" (will warn but run)"));
> + break;
> + case HOOKDIR_YES:
> + /*
> + * The default behavior should agree with
> + * hook.c:configured_hookdir_opt(). HOOKDIR_UNKNOWN should just
> + * do the default behavior.
> + */
> + case HOOKDIR_UNKNOWN:
> + default:
> + break;We should avoid this sort of translation lego.
Show 9 quoted lines
> + }
> +
> list_for_each(pos, head) {
> struct hook *item = list_entry(pos, struct hook, list);
> item = list_entry(pos, struct hook, list);
> if (item) {
> /* Don't translate 'hookdir' - it matches the config */
> - printf("%s: %s\n",
> + printf("%s: %s%s\n",native speakers in some languages to read the sentance backwards. Because if you concatenate strings like this you force.
(We don't currently have a RTL language in po/, still, but let's not create churn for if/when we do if we can help it)>
I have a patch on top to fix this, will send it as some general reply of proposed fixup.s
> (item->from_hookdir > + git hook list pre-commit >actual && > + # the hookdir annotation is translated > + test_i18ncmp expected actual
This (and the rest of test_i18ncmp in this series) can and should just be "test_cmp" or "test_i18ncmp", the poison mode is dead. See my recent patches to search/replace test_i18ncmp.
The reason the function isn't gone entirely was to help a series like yours in "seen", but if we're re-rolling...