blob: 32eea9b8752d02d1336e696c4b15346f1cadfacc [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
Christ van Willegence0ef912024-06-20 23:41:59 +020016 exe 'w! ' .. fnamemodify(name, ":r:gs?\\~?_?:gs?\\.?_?:gs?/?__?:gs?\\?__?") .. ".js"
Bram Moolenaar0b39c3f2020-08-30 15:52:10 +020017endfor
18
19quit