summaryrefslogtreecommitdiff
path: root/src/po/tojavascript.vim
blob: 7868570be75b188450e33d6cfb0b522f60b6aad1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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