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`");