Skip to content

Commit 0fd6c99

Browse files
committed
Merge branch 'ja/i18n'
The recent i18n patch we added during this cycle did a bit too much refactoring of the messages to avoid word-legos; the repetition has been reduced to help translators. * ja/i18n: i18n: simplify numeric error reporting i18n: fix git rebase interactive commit messages i18n: fix typos for translation
2 parents 3dc0170 + 078fe30 commit 0fd6c99

File tree

3 files changed

+20
-71
lines changed

3 files changed

+20
-71
lines changed

config.c

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -652,46 +652,34 @@ int git_parse_ulong(const char *value, unsigned long *ret)
652652
NORETURN
653653
static void die_bad_number(const char *name, const char *value)
654654
{
655+
const char * error_type = (errno == ERANGE)? _("out of range"):_("invalid unit");
656+
655657
if (!value)
656658
value = "";
657659

658660
if (!(cf && cf->name))
659-
die(errno == ERANGE
660-
? _("bad numeric config value '%s' for '%s': out of range")
661-
: _("bad numeric config value '%s' for '%s': invalid unit"),
662-
value, name);
661+
die(_("bad numeric config value '%s' for '%s': %s"),
662+
value, name, error_type);
663663

664664
switch (cf->origin_type) {
665665
case CONFIG_ORIGIN_BLOB:
666-
die(errno == ERANGE
667-
? _("bad numeric config value '%s' for '%s' in blob %s: out of range")
668-
: _("bad numeric config value '%s' for '%s' in blob %s: invalid unit"),
669-
value, name, cf->name);
666+
die(_("bad numeric config value '%s' for '%s' in blob %s: %s"),
667+
value, name, cf->name, error_type);
670668
case CONFIG_ORIGIN_FILE:
671-
die(errno == ERANGE
672-
? _("bad numeric config value '%s' for '%s' in file %s: out of range")
673-
: _("bad numeric config value '%s' for '%s' in file %s: invalid unit"),
674-
value, name, cf->name);
669+
die(_("bad numeric config value '%s' for '%s' in file %s: %s"),
670+
value, name, cf->name, error_type);
675671
case CONFIG_ORIGIN_STDIN:
676-
die(errno == ERANGE
677-
? _("bad numeric config value '%s' for '%s' in standard input: out of range")
678-
: _("bad numeric config value '%s' for '%s' in standard input: invalid unit"),
679-
value, name);
672+
die(_("bad numeric config value '%s' for '%s' in standard input: %s"),
673+
value, name, error_type);
680674
case CONFIG_ORIGIN_SUBMODULE_BLOB:
681-
die(errno == ERANGE
682-
? _("bad numeric config value '%s' for '%s' in submodule-blob %s: out of range")
683-
: _("bad numeric config value '%s' for '%s' in submodule-blob %s: invalid unit"),
684-
value, name, cf->name);
675+
die(_("bad numeric config value '%s' for '%s' in submodule-blob %s: %s"),
676+
value, name, cf->name, error_type);
685677
case CONFIG_ORIGIN_CMDLINE:
686-
die(errno == ERANGE
687-
? _("bad numeric config value '%s' for '%s' in command line %s: out of range")
688-
: _("bad numeric config value '%s' for '%s' in command line %s: invalid unit"),
689-
value, name, cf->name);
678+
die(_("bad numeric config value '%s' for '%s' in command line %s: %s"),
679+
value, name, cf->name, error_type);
690680
default:
691-
die(errno == ERANGE
692-
? _("bad numeric config value '%s' for '%s' in %s: out of range")
693-
: _("bad numeric config value '%s' for '%s' in %s: invalid unit"),
694-
value, name, cf->name);
681+
die(_("bad numeric config value '%s' for '%s' in %s: %s"),
682+
value, name, cf->name, error_type);
695683
}
696684
}
697685

git-rebase--interactive.sh

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -404,51 +404,12 @@ pick_one_preserving_merges () {
404404

405405
this_nth_commit_message () {
406406
n=$1
407-
case "$n" in
408-
1) gettext "This is the 1st commit message:";;
409-
2) gettext "This is the 2nd commit message:";;
410-
3) gettext "This is the 3rd commit message:";;
411-
4) gettext "This is the 4th commit message:";;
412-
5) gettext "This is the 5th commit message:";;
413-
6) gettext "This is the 6th commit message:";;
414-
7) gettext "This is the 7th commit message:";;
415-
8) gettext "This is the 8th commit message:";;
416-
9) gettext "This is the 9th commit message:";;
417-
10) gettext "This is the 10th commit message:";;
418-
# TRANSLATORS: if the language you are translating into
419-
# doesn't allow you to compose a sentence in this fashion,
420-
# consider translating as if this and the following few strings
421-
# were "This is the commit message ${n}:"
422-
*1[0-9]|*[04-9]) eval_gettext "This is the \${n}th commit message:";;
423-
*1) eval_gettext "This is the \${n}st commit message:";;
424-
*2) eval_gettext "This is the \${n}nd commit message:";;
425-
*3) eval_gettext "This is the \${n}rd commit message:";;
426-
*) eval_gettext "This is the commit message \${n}:";;
427-
esac
407+
eval_gettext "This is the commit message #\${n}:"
428408
}
409+
429410
skip_nth_commit_message () {
430411
n=$1
431-
case "$n" in
432-
1) gettext "The 1st commit message will be skipped:";;
433-
2) gettext "The 2nd commit message will be skipped:";;
434-
3) gettext "The 3rd commit message will be skipped:";;
435-
4) gettext "The 4th commit message will be skipped:";;
436-
5) gettext "The 5th commit message will be skipped:";;
437-
6) gettext "The 6th commit message will be skipped:";;
438-
7) gettext "The 7th commit message will be skipped:";;
439-
8) gettext "The 8th commit message will be skipped:";;
440-
9) gettext "The 9th commit message will be skipped:";;
441-
10) gettext "The 10th commit message will be skipped:";;
442-
# TRANSLATORS: if the language you are translating into
443-
# doesn't allow you to compose a sentence in this fashion,
444-
# consider translating as if this and the following few strings
445-
# were "The commit message ${n} will be skipped:"
446-
*1[0-9]|*[04-9]) eval_gettext "The \${n}th commit message will be skipped:";;
447-
*1) eval_gettext "The \${n}st commit message will be skipped:";;
448-
*2) eval_gettext "The \${n}nd commit message will be skipped:";;
449-
*3) eval_gettext "The \${n}rd commit message will be skipped:";;
450-
*) eval_gettext "The commit message \${n} will be skipped:";;
451-
esac
412+
eval_gettext "The commit message #\${n} will be skipped:"
452413
}
453414

454415
update_squash_messages () {

sequencer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ static struct commit *parse_insn_line(char *bol, char *eol, struct replay_opts *
702702
if (action != opts->action) {
703703
if (action == REPLAY_REVERT)
704704
error((opts->action == REPLAY_REVERT)
705-
? _("Cannot revert during a another revert.")
705+
? _("Cannot revert during another revert.")
706706
: _("Cannot revert during a cherry-pick."));
707707
else
708708
error((opts->action == REPLAY_REVERT)

0 commit comments

Comments
 (0)