-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
10 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
" These commands create the option window. | ||
" | ||
" Maintainer: Bram Moolenaar <[email protected]> | ||
" Last Change: 2020 Jun 10 | ||
" Last Change: 2020 aug 30 | ||
|
||
" If there already is an option window, jump to that one. | ||
let buf = bufnr('option-window') | ||
|
@@ -145,13 +145,13 @@ exe $OPTWIN_CMD . ' new option-window' | |
setlocal ts=15 tw=0 noro buftype=nofile | ||
|
||
" Insert help and a "set" command for each option. | ||
call append(0, '" Each "set" line shows the current value of an option (on the left).') | ||
call append(1, '" Hit <CR> on a "set" line to execute it.') | ||
call append(2, '" A boolean option will be toggled.') | ||
call append(3, '" For other options you can edit the value before hitting <CR>.') | ||
call append(4, '" Hit <CR> on a help line to open a help window on this option.') | ||
call append(5, '" Hit <CR> on an index line to jump there.') | ||
call append(6, '" Hit <Space> on a "set" line to refresh it.') | ||
call append(0, gettext('" Each "set" line shows the current value of an option (on the left).')) | ||
call append(1, gettext('" Hit <Enter> on a "set" line to execute it.')) | ||
call append(2, gettext('" A boolean option will be toggled.')) | ||
call append(3, gettext('" For other options you can edit the value before hitting <Enter>.')) | ||
call append(4, gettext('" Hit <Enter> on a help line to open a help window on this option.')) | ||
call append(5, gettext('" Hit <Enter> on an index line to jump there.')) | ||
call append(6, gettext('" Hit <Space> on a "set" line to refresh it.')) | ||
|
||
" These functions are called often below. Keep them fast! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
" 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. | ||
|
||
set shortmess+=A | ||
|
||
for name in argv()[1:] | ||
let jsname = fnamemodify(name, ":t:r") .. ".js" | ||
exe "%s+" .. jsname .. "+" .. name .. "+" | ||
endfor | ||
|
||
write | ||
last | ||
quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters