Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
9753:bba3d9fa5a35 | 9754:a990e7ed260b |
---|---|
1851 } | 1851 } |
1852 | 1852 |
1853 /* get_foldtext() {{{2 */ | 1853 /* get_foldtext() {{{2 */ |
1854 /* | 1854 /* |
1855 * Return the text for a closed fold at line "lnum", with last line "lnume". | 1855 * Return the text for a closed fold at line "lnum", with last line "lnume". |
1856 * When 'foldtext' isn't set puts the result in "buf[51]". Otherwise the | 1856 * When 'foldtext' isn't set puts the result in "buf[FOLD_TEXT_LEN]". |
1857 * result is in allocated memory. | 1857 * Otherwise the result is in allocated memory. |
1858 */ | 1858 */ |
1859 char_u * | 1859 char_u * |
1860 get_foldtext( | 1860 get_foldtext( |
1861 win_T *wp, | 1861 win_T *wp, |
1862 linenr_T lnum, | 1862 linenr_T lnum, |
1958 } | 1958 } |
1959 } | 1959 } |
1960 if (text == NULL) | 1960 if (text == NULL) |
1961 #endif | 1961 #endif |
1962 { | 1962 { |
1963 sprintf((char *)buf, _("+--%3ld lines folded "), | 1963 long count = (long)(lnume - lnum + 1); |
1964 (long)(lnume - lnum + 1)); | 1964 |
1965 vim_snprintf((char *)buf, FOLD_TEXT_LEN, | |
1966 ngettext("+--%3ld line folded ", | |
1967 "+--%3ld lines folded ", count), | |
1968 count); | |
1965 text = buf; | 1969 text = buf; |
1966 } | 1970 } |
1967 return text; | 1971 return text; |
1968 } | 1972 } |
1969 | 1973 |