Mercurial > vim
comparison runtime/optwin.vim @ 21989:52e970719f4b v8.2.1544
patch 8.2.1544: cannot translate messages in a Vim script
Commit: https://github.com/vim/vim/commit/0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 30 15:52:10 2020 +0200
patch 8.2.1544: cannot translate messages in a Vim script
Problem: Cannot translate messages in a Vim script.
Solution: Add gettext(). Try it out for a few messages in the options
window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 30 Aug 2020 16:00:04 +0200 |
parents | 83cfa1ef1bf2 |
children | 786ca9e1dc9a |
comparison
equal
deleted
inserted
replaced
21988:e3a2f5300336 | 21989:52e970719f4b |
---|---|
1 " These commands create the option window. | 1 " These commands create the option window. |
2 " | 2 " |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | 3 " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 " Last Change: 2020 Jun 10 | 4 " Last Change: 2020 aug 30 |
5 | 5 |
6 " If there already is an option window, jump to that one. | 6 " If there already is an option window, jump to that one. |
7 let buf = bufnr('option-window') | 7 let buf = bufnr('option-window') |
8 if buf >= 0 | 8 if buf >= 0 |
9 let winids = win_findbuf(buf) | 9 let winids = win_findbuf(buf) |
143 " Open the window. $OPTWIN_CMD is set to "tab" for ":tab options". | 143 " Open the window. $OPTWIN_CMD is set to "tab" for ":tab options". |
144 exe $OPTWIN_CMD . ' new option-window' | 144 exe $OPTWIN_CMD . ' new option-window' |
145 setlocal ts=15 tw=0 noro buftype=nofile | 145 setlocal ts=15 tw=0 noro buftype=nofile |
146 | 146 |
147 " Insert help and a "set" command for each option. | 147 " Insert help and a "set" command for each option. |
148 call append(0, '" Each "set" line shows the current value of an option (on the left).') | 148 call append(0, gettext('" Each "set" line shows the current value of an option (on the left).')) |
149 call append(1, '" Hit <CR> on a "set" line to execute it.') | 149 call append(1, gettext('" Hit <Enter> on a "set" line to execute it.')) |
150 call append(2, '" A boolean option will be toggled.') | 150 call append(2, gettext('" A boolean option will be toggled.')) |
151 call append(3, '" For other options you can edit the value before hitting <CR>.') | 151 call append(3, gettext('" For other options you can edit the value before hitting <Enter>.')) |
152 call append(4, '" Hit <CR> on a help line to open a help window on this option.') | 152 call append(4, gettext('" Hit <Enter> on a help line to open a help window on this option.')) |
153 call append(5, '" Hit <CR> on an index line to jump there.') | 153 call append(5, gettext('" Hit <Enter> on an index line to jump there.')) |
154 call append(6, '" Hit <Space> on a "set" line to refresh it.') | 154 call append(6, gettext('" Hit <Space> on a "set" line to refresh it.')) |
155 | 155 |
156 " These functions are called often below. Keep them fast! | 156 " These functions are called often below. Keep them fast! |
157 | 157 |
158 " Init a local binary option | 158 " Init a local binary option |
159 fun! <SID>BinOptionL(name) | 159 fun! <SID>BinOptionL(name) |