Mercurial > vim
diff src/fold.c @ 9754:a990e7ed260b v7.4.2152
commit https://github.com/vim/vim/commit/ee695f787ade7fd88fc5f5497553d95c0c3645b5
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 3 22:08:45 2016 +0200
patch 7.4.2152
Problem: No proper translation of messages with a count.
Solution: Use ngettext(). (Sergey Alyoshin)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 03 Aug 2016 22:15:06 +0200 |
parents | 32e34e574716 |
children | 4aead6a9b7a9 |
line wrap: on
line diff
--- a/src/fold.c +++ b/src/fold.c @@ -1853,8 +1853,8 @@ foldDelMarker(linenr_T lnum, char_u *mar /* get_foldtext() {{{2 */ /* * Return the text for a closed fold at line "lnum", with last line "lnume". - * When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the - * result is in allocated memory. + * When 'foldtext' isn't set puts the result in "buf[FOLD_TEXT_LEN]". + * Otherwise the result is in allocated memory. */ char_u * get_foldtext( @@ -1960,8 +1960,12 @@ get_foldtext( if (text == NULL) #endif { - sprintf((char *)buf, _("+--%3ld lines folded "), - (long)(lnume - lnum + 1)); + long count = (long)(lnume - lnum + 1); + + vim_snprintf((char *)buf, FOLD_TEXT_LEN, + ngettext("+--%3ld line folded ", + "+--%3ld lines folded ", count), + count); text = buf; } return text;