Merge branch 'ja/i18n-common-messages'

Unify more messages to help l10n.

* ja/i18n-common-messages:
  i18n: fix some misformated placeholders in command synopsis
  i18n: remove from i18n strings that do not hold translatable parts
  i18n: factorize "invalid value" messages
  i18n: factorize more 'incompatible options' messages
This commit is contained in:
Junio C Hamano
2022-02-25 15:47:35 -08:00
42 changed files with 137 additions and 85 deletions

View File

@ -1092,3 +1092,37 @@ void NORETURN usage_msg_optf(const char * const fmt,
usage_msg_opt(msg.buf, usagestr, options);
}
void die_for_incompatible_opt4(int opt1, const char *opt1_name,
int opt2, const char *opt2_name,
int opt3, const char *opt3_name,
int opt4, const char *opt4_name)
{
int count = 0;
const char *options[4];
if (opt1)
options[count++] = opt1_name;
if (opt2)
options[count++] = opt2_name;
if (opt3)
options[count++] = opt3_name;
if (opt4)
options[count++] = opt4_name;
switch (count) {
case 4:
die(_("options '%s', '%s', '%s', and '%s' cannot be used together"),
opt1_name, opt2_name, opt3_name, opt4_name);
break;
case 3:
die(_("options '%s', '%s', and '%s' cannot be used together"),
options[0], options[1], options[2]);
break;
case 2:
die(_("options '%s' and '%s' cannot be used together"),
options[0], options[1]);
break;
default:
break;
}
}