diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-27 18:08:06 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-28 08:03:31 +0800 |
| commit | 5568267ccb94924b9dcf7bfa5d52da0f16d161e4 (patch) | |
| tree | d62afdcc3603149e9c6834b0f9536018e93e3d93 /src/nvim/po/tojavascript.vim | |
| parent | f44ad753801d881f5352c9182167ced18e79e456 (diff) | |
| download | rneovim-5568267ccb94924b9dcf7bfa5d52da0f16d161e4.tar.gz rneovim-5568267ccb94924b9dcf7bfa5d52da0f16d161e4.tar.bz2 rneovim-5568267ccb94924b9dcf7bfa5d52da0f16d161e4.zip | |
vim-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.
https://github.com/vim/vim/commit/0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/po/tojavascript.vim')
| -rw-r--r-- | src/nvim/po/tojavascript.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/po/tojavascript.vim b/src/nvim/po/tojavascript.vim new file mode 100644 index 0000000000..7868570be7 --- /dev/null +++ b/src/nvim/po/tojavascript.vim @@ -0,0 +1,18 @@ +" Invoked with the name "vim.pot" and a list of Vim script names. +" Converts them to a .js file, stripping comments, so that xgettext works. +" Javascript is used because, like Vim, it accepts both single and double +" quoted strings. + +set shortmess+=A + +for name in argv()[1:] + exe 'edit ' .. fnameescape(name) + + " Strip comments + g/^\s*"/s/.*// + + " Write as .js file, xgettext recognizes them + exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js" +endfor + +quit |