blob: 8b0dd736d50c1c68bb82851ed5cab2d13664ff41 [file] [log] [blame]
Bram Moolenaar0b39c3f2020-08-30 15:52:10 +02001" Invoked with the name "vim.pot" and a list of Vim script names.
2" Converts them to a .js file, stripping comments, so that xgettext works.
3" Javascript is used because, like Vim, it accepts both single and double
4" quoted strings.
5
6set shortmess+=A
7
8for name in argv()[1:]
9 exe 'edit ' .. fnameescape(name)
10
Bram Moolenaar65b34862023-05-10 14:47:50 +010011 " Strip comments, also after :set commands.
Bram Moolenaar0b39c3f2020-08-30 15:52:10 +020012 g/^\s*"/s/.*//
Bram Moolenaar65b34862023-05-10 14:47:50 +010013 g/^\s*set .*"/s/.*//
Bram Moolenaar0b39c3f2020-08-30 15:52:10 +020014
15 " Write as .js file, xgettext recognizes them
16 exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js"
17endfor
18
19quit