On Tue, Aug 21, 2018 at 5:08 PM, Tony Mechelynck <[email protected]> wrote: > On Tue, Aug 21, 2018 at 3:12 PM, Bram Moolenaar <[email protected]> wrote: >> >> Patch 8.1.0306 >> Problem: Plural messages are not translated properly. >> Solution: Add more usage of NGETTEXT(). (Sergey Alyoshin) >> Files: src/vim.h, src/buffer.c, src/ex_cmds.c, src/ex_docmd.c, >> src/fileio.c, src/misc1.c, src/ops.c > > There are still more. (Big gvim 8.1.306 with GTK2 GUI) > > I just noticed that when hitting u (Undo), if the previous change > happened just 1 second ago, the message displayed at the bottom of the > screen says "1 change" (which is correct) but also "1 seconds ago" > (which is not).
Patch for this message in undo.c file > Hitting u that fast doesn't happen much, but we shouldn't forget the > possibility that languages other than English form their plural > differently: for instance Russian has "agreement by proximity" after a > numeral, so that the singular is used not only with 1 but also with > 21, 31, 41, etc. (and the dual with 2-4, 22-24, 32-34, 42-44, etc.). > (Russian cardinal numbers are constructed in a mannar parallel to > those of English, French, etc., where 11-19 have their own single-word > names not ending in 1-9.) Не правда ли, Сережа? ;-) Чистая правда. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
From 7afa749f843de8fcf63f0736bfc21d678aa95124 Mon Sep 17 00:00:00 2001 From: Sergey Alyoshin <[email protected]> Date: Tue, 21 Aug 2018 17:27:23 +0300 Subject: [PATCH] Use NGETTEXT() for undo was "seconds ago" message --- src/undo.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/undo.c b/src/undo.c index 040ec54..d74a42c 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3109,13 +3109,15 @@ ex_undolist(exarg_T *eap UNUSED) static void u_add_time(char_u *buf, size_t buflen, time_t tt) { + time_t td = vim_time() - tt; + #ifdef HAVE_STRFTIME struct tm *curtime; - if (vim_time() - tt >= 100) + if (td >= 100) { curtime = localtime(&tt); - if (vim_time() - tt < (60L * 60L * 12L)) + if (td < (60L * 60L * 12L)) /* within 12 hours */ (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); else @@ -3124,8 +3126,8 @@ u_add_time(char_u *buf, size_t buflen, time_t tt) } else #endif - vim_snprintf((char *)buf, buflen, _("%ld seconds ago"), - (long)(vim_time() - tt)); + vim_snprintf((char *)buf, buflen, NGETTEXT("%ld second ago", + "%ld seconds ago", (long)td), (long)td); } /* -- 2.18.0
