Re: [PATCH 00/10] Factorization of messages with similar meaning
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Dec 3, 2021, 23:39 UTC
- Message-ID
- <d687f69b-efdc-6b1c-c63c-8544ff37d1c2@kdbg.org>
- In-Reply-To
- <YaqSXvp6ZxOFqeuk@coredump.intra.peff.net>
Am 03.12.21 um 22:55 schrieb Jeff King:
Show 24 quoted lines
> On Fri, Dec 03, 2021 at 07:01:39AM +0000, Jean-Noël Avila via GitGitGadget wrote: > >> This series is a meager attempt at rationalizing a small fraction of the >> internationalized messages. Sorry in advance for the dull task of reviewing >> these insipide patches. >> >> Doing so has some positive effects: >> >> * non-translatable constant strings are kept out of the way for translators >> * messages with identical meaning are built identically >> * the total number of messages to translate is decreased. >> >> I'm inclined to even go a step further and turn these messages into #define >> or const strings. This would have the added benefits: >> >> * make sure that the messages to translate are identical >> * create a library of message skeletons to be picked up when new messages >> are needed >> >> What do you think? > > One slight negative of this approach is that it makes messages a bit > harder to grep for. It sometimes really nice to "git jump grep" for > specific messages you got to see where they're coming from.
This can be mitigated by using, for example,
git grep -e --stdin --and -e mutually
as long as the rewrite keeps the arguments on the same line with the format strings, which it does.
Another aspect is that translators lose context. For example, "%s and %s are mutally exclusive" may have to be translated differently depending on what kind of text is substituted for %s. In this example it's probably always command line options (I haven't checked), so not an immediate problem. But something to keep in mind.
-- Hannes