Mercurial > vim
comparison src/vim9execute.c @ 29322:ac102d0fb50f v9.0.0004
patch 9.0.0004: plural messages not translated properly
Commit: https://github.com/vim/vim/commit/d14bb1aef9a142f403aa16298c23db2751de9391
Author: Matvey Tarasov <matthewtarasov@yandex.ru>
Date: Wed Jun 29 13:18:27 2022 +0100
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 29 Jun 2022 14:30:04 +0200 |
parents | 3043a3e2ef95 |
children | aeba55253de4 |
comparison
equal
deleted
inserted
replaced
29321:81f357198a78 | 29322:ac102d0fb50f |
---|---|
476 } | 476 } |
477 | 477 |
478 arg_to_add = ufunc->uf_args.ga_len - argcount; | 478 arg_to_add = ufunc->uf_args.ga_len - argcount; |
479 if (arg_to_add < 0) | 479 if (arg_to_add < 0) |
480 { | 480 { |
481 if (arg_to_add == -1) | 481 semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many, |
482 emsg(_(e_one_argument_too_many)); | 482 -arg_to_add), -arg_to_add); |
483 else | |
484 semsg(_(e_nr_arguments_too_many), -arg_to_add); | |
485 return FAIL; | 483 return FAIL; |
486 } | 484 } |
487 else if (arg_to_add > ufunc->uf_def_args.ga_len) | 485 else if (arg_to_add > ufunc->uf_def_args.ga_len) |
488 { | 486 { |
489 int missing = arg_to_add - ufunc->uf_def_args.ga_len; | 487 int missing = arg_to_add - ufunc->uf_def_args.ga_len; |
490 | 488 |
491 if (missing == 1) | 489 semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few, |
492 emsg(_(e_one_argument_too_few)); | 490 missing), missing); |
493 else | |
494 semsg(_(e_nr_arguments_too_few), missing); | |
495 return FAIL; | 491 return FAIL; |
496 } | 492 } |
497 | 493 |
498 // Reserve space for: | 494 // Reserve space for: |
499 // - missing arguments | 495 // - missing arguments |
5168 ++ex_nesting_level; | 5164 ++ex_nesting_level; |
5169 | 5165 |
5170 idx = argc - ufunc->uf_args.ga_len; | 5166 idx = argc - ufunc->uf_args.ga_len; |
5171 if (idx > 0 && ufunc->uf_va_name == NULL) | 5167 if (idx > 0 && ufunc->uf_va_name == NULL) |
5172 { | 5168 { |
5173 if (idx == 1) | 5169 semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many, |
5174 emsg(_(e_one_argument_too_many)); | 5170 idx), idx); |
5175 else | |
5176 semsg(_(e_nr_arguments_too_many), idx); | |
5177 goto failed_early; | 5171 goto failed_early; |
5178 } | 5172 } |
5179 idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len; | 5173 idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len; |
5180 if (idx < 0) | 5174 if (idx < 0) |
5181 { | 5175 { |
5182 if (idx == -1) | 5176 semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few, |
5183 emsg(_(e_one_argument_too_few)); | 5177 -idx), -idx); |
5184 else | |
5185 semsg(_(e_nr_arguments_too_few), -idx); | |
5186 goto failed_early; | 5178 goto failed_early; |
5187 } | 5179 } |
5188 | 5180 |
5189 // Put arguments on the stack, but no more than what the function expects. | 5181 // Put arguments on the stack, but no more than what the function expects. |
5190 // A lambda can be called with more arguments than it uses. | 5182 // A lambda can be called with more arguments than it uses. |