Mercurial > vim
comparison src/ex_cmds.c @ 14585:c8f07e8b273e v8.1.0306
patch 8.1.0306: plural messages are not translated properly
commit https://github.com/vim/vim/commit/da6e8919e75fa8f961d1b805e877c8a92e76dafb
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Aug 21 15:12:14 2018 +0200
patch 8.1.0306: plural messages are not translated properly
Problem: Plural messages are not translated properly.
Solution: Add more usage of NGETTEXT(). (Sergey Alyoshin)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 21 Aug 2018 15:15:06 +0200 |
parents | 076b9632bda4 |
children | 193471015e1a |
comparison
equal
deleted
inserted
replaced
14584:443ccbfc2be0 | 14585:c8f07e8b273e |
---|---|
983 | 983 |
984 for (l = line1; l <= line2; l++) | 984 for (l = line1; l <= line2; l++) |
985 ml_delete(line1 + extra, TRUE); | 985 ml_delete(line1 + extra, TRUE); |
986 | 986 |
987 if (!global_busy && num_lines > p_report) | 987 if (!global_busy && num_lines > p_report) |
988 { | 988 smsg((char_u *)NGETTEXT("%ld line moved", "%ld lines moved", num_lines), |
989 if (num_lines == 1) | 989 (long)num_lines); |
990 MSG(_("1 line moved")); | |
991 else | |
992 smsg((char_u *)_("%ld lines moved"), num_lines); | |
993 } | |
994 | 990 |
995 /* | 991 /* |
996 * Leave the cursor on the last of the moved lines. | 992 * Leave the cursor on the last of the moved lines. |
997 */ | 993 */ |
998 if (dest >= line1) | 994 if (dest >= line1) |
5938 */ | 5934 */ |
5939 if (((sub_nsubs > p_report && (KeyTyped || sub_nlines > 1 || p_report < 1)) | 5935 if (((sub_nsubs > p_report && (KeyTyped || sub_nlines > 1 || p_report < 1)) |
5940 || count_only) | 5936 || count_only) |
5941 && messaging()) | 5937 && messaging()) |
5942 { | 5938 { |
5939 char *msg_single; | |
5940 char *msg_plural; | |
5941 | |
5943 if (got_int) | 5942 if (got_int) |
5944 STRCPY(msg_buf, _("(Interrupted) ")); | 5943 STRCPY(msg_buf, _("(Interrupted) ")); |
5945 else | 5944 else |
5946 *msg_buf = NUL; | 5945 *msg_buf = NUL; |
5947 if (sub_nsubs == 1) | 5946 |
5948 vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), | 5947 msg_single = count_only |
5949 "%s", count_only ? _("1 match") : _("1 substitution")); | 5948 ? NGETTEXT("%ld match on %ld line", |
5950 else | 5949 "%ld matches on %ld line", sub_nsubs) |
5951 vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), | 5950 : NGETTEXT("%ld substitution on %ld line", |
5952 count_only ? _("%ld matches") : _("%ld substitutions"), | 5951 "%ld substitutions on %ld line", sub_nsubs); |
5953 sub_nsubs); | 5952 msg_plural = count_only |
5954 if (sub_nlines == 1) | 5953 ? NGETTEXT("%ld match on %ld lines", |
5955 vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), | 5954 "%ld matches on %ld lines", sub_nsubs) |
5956 "%s", _(" on 1 line")); | 5955 : NGETTEXT("%ld substitution on %ld lines", |
5957 else | 5956 "%ld substitutions on %ld lines", sub_nsubs); |
5958 vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), | 5957 |
5959 _(" on %ld lines"), (long)sub_nlines); | 5958 vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), |
5959 NGETTEXT(msg_single, msg_plural, sub_nlines), | |
5960 sub_nsubs, (long)sub_nlines); | |
5961 | |
5960 if (msg(msg_buf)) | 5962 if (msg(msg_buf)) |
5961 /* save message to display it after redraw */ | 5963 /* save message to display it after redraw */ |
5962 set_keep_msg(msg_buf, 0); | 5964 set_keep_msg(msg_buf, 0); |
5963 return TRUE; | 5965 return TRUE; |
5964 } | 5966 } |