2020-08-30 15:52:10 +02:00
|
|
|
" 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)
|
|
|
|
|
|
2023-05-10 14:47:50 +01:00
|
|
|
" Strip comments, also after :set commands.
|
2020-08-30 15:52:10 +02:00
|
|
|
g/^\s*"/s/.*//
|
2023-05-10 14:47:50 +01:00
|
|
|
g/^\s*set .*"/s/.*//
|
2020-08-30 15:52:10 +02:00
|
|
|
|
|
|
|
|
" Write as .js file, xgettext recognizes them
|
|
|
|
|
exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js"
|
|
|
|
|
endfor
|
|
|
|
|
|
|
|
|
|
quit
|