git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "Jean-Noël Avila" <jn.avila@free.fr>,
	git@vger.kernel.org,
	"Jean-Noël Avila via GitGitGadget" <gitgitgadget@gmail.com>
Subject: Re: [PATCH 0/7] More i18n fixes
Date: Mon, 21 Mar 2022 14:59:24 +0100	[thread overview]
Message-ID: <220321.86ils79z0c.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <e44b6ccf-21a2-72c6-4d40-dc0004895255@kdbg.org>


On Mon, Mar 21 2022, Johannes Sixt wrote:

> Am 20.03.22 um 22:54 schrieb Jean-Noël Avila via GitGitGadget:
>> This is another i18n PR (and hopefully the last for a while).
>> 
>> As usual, the intent is kept the same: curbing the number of strings to
>> translate, remove constant, error prone parts out of the way, trying in some
>> sense to "put a precedent" so that the template strings can be reused later.
>
> I feel that many of the example conversions look like sentence lego
> because there remains only one English word, e.g., "'%s' failed". The
> converted code does not leave a hint for the translators what the %s
> will be. Is it a command, a function name, somehting else? Even if the
> hint was provided, different translations may be required depending on
> the substituted entity. Did you investigate the existing translations
> whether all of them can be converted to the new scheme?
>
>> This series has also a RFC status: can "bad argument" messages be merged
>> with unrecognized argument?
>
> The cases that patch 7/7 transforms look like they need not keep
> "unrecognized argument", but can be converted to "bad argument".
>
> Disclaimer: neither am I a translator nor a user of a translated Git.

Just to add to this:

 - Careful use of sentence lego is OK, but e.g. in my native language a
   command-line option would use a male noun article, whereas commands
   would be feminine.

   (I still haven't submitted an Icelandic translation, but this applies
   in general).

   As a result string like "'%s' failed" can be *workable*, i.e. you can
   translate it assuming you'll get any arbitrary string, but the
   translation will often be rather tortured.

   So it's much preferred (and this also goes to Johannes's comment) to
   instead do e.g.:

       "failed to run the '%s' command"
       "failed to use the '%s' argument"

   Or whatever, and e.g. for:
	
	-		return strbuf_addf_ret(err, -1, _("%%(objecttype) does not take arguments"));
	+		return strbuf_addf_ret(err, -1, _("%s does not take arguments"), "%(objecttype)");

   Instead say "the '%s' format does not...", i.e. disambiguate with
   "format".

 - While perfect shouldn't be the enemy of the good, it would be most
   welcome to improve some of the warts revealed by these messages,
   notably that e.g. the "failed to run X command" don't report
   errno. E.g. this in git.c is a good template (except for the "\n" we
   should ideally get rid of):

       _("failed to run command '%s': %s\n")

 - On that topic, it would be really useful to see if we can unify some
   of these with *existing* po/git.pot messaging, I don't know if that's
   part of your workflow, but in some cases I've seen we can either
   tweak wording slightly to match an existing message, or could further
   unify some existing similar messages.

 - Even if we say "failed to run git-apply" or whatever now we should
   really be adding quotes to these as we convert them. In some cases
   the changes that (good):
	
	-		die(_("git-http-push failed"));
	+		die(_("'%s' failed"), "git-http-push");

   But not in others (bad):
	
	-		res = error(_("Bad bisect_write argument: %s"), state);
	+		res = error(_("bad %s argument: %s"), "bisect_write", state);

   I.e. that should be 'bad '%s' argument. And also on the "unify" point
   above, e.g. grep.c has this:

       grep.c: die("bad %s argument: %s", opt, arg);

   So we could covert that one to "bad '%s' argument: '%s"" while we're
   at it...

- In some cases there's ucase to lcase conversions, like Bad->bad above
  (good), but others are missed, e.g. (also missing quotes as noted
  above):

	-		die(_("Server does not support --shallow-since"));
	+		die(_("Server does not support %s"), "--shallow-since");

 - On quotes, let's consistently use '' quotes, and not e.g.g:
	
	-		die(_("`scalar list` does not take arguments"));
	+		die(_("%s does not take arguments"), "`scalar list`");


  reply	other threads:[~2022-03-21 14:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-20 21:54 [PATCH 0/7] More i18n fixes Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 1/7] i18n: factorize generic failure messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 2/7] sequencer: factor GIT_AUTHOR_* from message strings Bagas Sanjaya via GitGitGadget
2022-03-21  5:22   ` Bagas Sanjaya
2022-03-20 21:54 ` [PATCH 3/7] i18n: factorize "bad argument" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 4/7] i18n: factorize "Server does not support foo" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 5/7] i18n: factorize "foo does not take arguments" messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 6/7] i18n: factorize read-cache error messages Jean-Noël Avila via GitGitGadget
2022-03-20 21:54 ` [PATCH 7/7] i18n: factorize unrecognized options arguments messages Jean-Noël Avila via GitGitGadget
2022-03-21  6:48 ` [PATCH 0/7] More i18n fixes Johannes Sixt
2022-03-21 13:59   ` Ævar Arnfjörð Bjarmason [this message]
2022-03-21 19:03     ` Junio C Hamano
2022-03-21 20:13       ` Jean-Noël AVILA
2022-03-21 20:35     ` Jean-Noël AVILA
2022-04-02 16:10 ` [PATCH v2 0/6] " Jean-Noël Avila via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 1/6] i18n: factorize generic failure messages Jean-Noël Avila via GitGitGadget
2022-04-03  5:56     ` Bagas Sanjaya
2022-04-03 14:34       ` Ævar Arnfjörð Bjarmason
2022-04-03 14:47     ` Ævar Arnfjörð Bjarmason
2022-04-02 16:10   ` [PATCH v2 2/6] sequencer: factor GIT_AUTHOR_* from message strings Bagas Sanjaya via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 3/6] i18n: factorize server support messages in fetch-pack Jean-Noël Avila via GitGitGadget
2022-04-02 16:10   ` [PATCH v2 4/6] i18n: factorize "foo does not take arguments" messages Jean-Noël Avila via GitGitGadget
2022-04-03 14:39     ` Ævar Arnfjörð Bjarmason
2022-04-03 22:21       ` Junio C Hamano
2022-04-02 16:10   ` [PATCH v2 5/6] i18n: factorize read-cache error messages Jean-Noël Avila via GitGitGadget
2022-04-03 22:29     ` Junio C Hamano
2022-04-02 16:10   ` [PATCH v2 6/6] i18n: factorize "bad argument" messages Jean-Noël Avila via GitGitGadget
2022-04-03 14:41     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220321.86ils79z0c.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=j6t@kdbg.org \
    --cc=jn.avila@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).