To: vim_dev@googlegroups.com Subject: Patch 9.0.1575 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1575 Problem: "file N of M" message is not translated. Solution: Make argument count message translatable. (close #12429) Files: src/buffer.c *** ../vim-9.0.1574/src/buffer.c 2023-05-20 14:06:56.669542805 +0100 --- src/buffer.c 2023-05-23 17:56:41.331542365 +0100 *************** *** 5278,5301 **** int buflen, int add_file) // Add "file" before the arg number { - char_u *p; - if (ARGCOUNT <= 1) // nothing to do return FALSE; ! p = buf + STRLEN(buf); // go to the end of the buffer ! if (p - buf + 35 >= buflen) // getting too long ! return FALSE; ! *p++ = ' '; ! *p++ = '('; ! if (add_file) { ! STRCPY(p, "file "); ! p += 5; } ! vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), ! wp->w_arg_idx_invalid ? "(%d) of %d)" ! : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT); return TRUE; } --- 5278,5298 ---- int buflen, int add_file) // Add "file" before the arg number { if (ARGCOUNT <= 1) // nothing to do return FALSE; ! char *msg; ! switch ((wp->w_arg_idx_invalid ? 1 : 0) + (add_file ? 2 : 0)) { ! case 0: msg = _(" (%d of %d)"); break; ! case 1: msg = _(" ((%d) of %d)"); break; ! case 2: msg = _(" (file %d of %d)"); break; ! case 3: msg = _(" (file (%d) of %d)"); break; } ! ! char_u *p = buf + STRLEN(buf); // go to the end of the buffer ! vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), msg, ! wp->w_arg_idx + 1, ARGCOUNT); return TRUE; } *** ../vim-9.0.1574/src/version.c 2023-05-23 15:27:47.011308166 +0100 --- src/version.c 2023-05-23 18:00:02.139363549 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1575, /**/ -- I'm trying to be an optimist, but I don't think it'll work. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///