Skip to content

Commit d14bb1a

Browse files
Matvey Tarasovbrammool
authored andcommitted
patch 9.0.0004: plural messages not translated properly
Problem: Plural messages not translated properly. Solution: Use ngettext() in a few more places. (Matvey Tarasov, closes #10606)
1 parent ee47eac commit d14bb1a

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
4,
738740
/**/
739741
3,
740742
/**/

src/vim9execute.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -478,20 +478,16 @@ call_dfunc(
478478
arg_to_add = ufunc->uf_args.ga_len - argcount;
479479
if (arg_to_add < 0)
480480
{
481-
if (arg_to_add == -1)
482-
emsg(_(e_one_argument_too_many));
483-
else
484-
semsg(_(e_nr_arguments_too_many), -arg_to_add);
481+
semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
482+
-arg_to_add), -arg_to_add);
485483
return FAIL;
486484
}
487485
else if (arg_to_add > ufunc->uf_def_args.ga_len)
488486
{
489487
int missing = arg_to_add - ufunc->uf_def_args.ga_len;
490488

491-
if (missing == 1)
492-
emsg(_(e_one_argument_too_few));
493-
else
494-
semsg(_(e_nr_arguments_too_few), missing);
489+
semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
490+
missing), missing);
495491
return FAIL;
496492
}
497493

@@ -5170,19 +5166,15 @@ call_def_function(
51705166
idx = argc - ufunc->uf_args.ga_len;
51715167
if (idx > 0 && ufunc->uf_va_name == NULL)
51725168
{
5173-
if (idx == 1)
5174-
emsg(_(e_one_argument_too_many));
5175-
else
5176-
semsg(_(e_nr_arguments_too_many), idx);
5169+
semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
5170+
idx), idx);
51775171
goto failed_early;
51785172
}
51795173
idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
51805174
if (idx < 0)
51815175
{
5182-
if (idx == -1)
5183-
emsg(_(e_one_argument_too_few));
5184-
else
5185-
semsg(_(e_nr_arguments_too_few), -idx);
5176+
semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
5177+
-idx), -idx);
51865178
goto failed_early;
51875179
}
51885180

0 commit comments

Comments
 (0)