git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Make a colon translatable

From
JPJulien Palard <julien@palard.fr>
Date
Apr 12, 2022, 07:30 UTC
Message-ID
<CmgFntqFQcIxsSKePSKmmWvAMwsl-9shDqzWTT9GqI3S6PXNdhTTX6LypjY0l-R8B52pkh_MpYtq-NbbDjXT6EuZ9_S-QV4cUqxKhjZUpw8=@palard.fr>
In-Reply-To
<xmqq5ynfh101.fsf@gitster.g>
Hi, thanks for you feedback!
> Sorry, but I do not quite buy this. The above is a representative
> example of what we call "sentence lego", which is what we absolutely
> want to avoid, isn't it?
I never heard of "sentence lego" but I can easily imagine it's building sentences by mixing multiple levels of gettext and printf-like formatting, typically freezing the order of sentence components, rendering them untranslatable in some languages, like printf(_("if %s then %s"), _(if_part), _(then_part))? I I'm wrong tell me because I may have misundertood your whole point.
Show 5 quoted lines
> We'd rather want to see
>
> printf_like_function(("Use 'git %s' ...", "string"));
>
> when "string" is something that should not be translated
Make sense.
> I.e. this one is better handled by
>
> status_printf_ln(s, c, _("%s:"), what);
I understand your comment while seeing my badly choosen example with `_("some string:")`, but in the patch isn't your proposition more sentence-lego-ish than mine? If I understand correctly you're proposing to replace:
    printf("%s", _("Untracked files:"))
with:
    printf(_("%s:"), _("Untracked files"))
This hides information to the translator (the presence of a following colon while translating 'Untracked files'). It would be OK if we were 100% sure no translations can be impacted by this. I only speak french and english, so I don't know. Maybe I should rename `what` to `heading`? I may clarify a bit, `what` make me feel it can be reused, but it's only used once alone on its line.

Bests, --  Julien Palard https://mdk.fr

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “Make a colon translatable”
  1. Make a colon translatableJulien Palard, Apr 11, 2022
  2. Junio C HamanoApr 11, 2022
  3. Ævar Arnfjörð BjarmasonApr 12, 2022
  4. Junio C HamanoApr 12, 2022
  5. Jean-Noël AvilaApr 13, 2022
  6. Junio C HamanoApr 13, 2022
  7. Julien PalardApr 12, 2022
  8. Junio C HamanoApr 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.