Bram Moolenaar | 0b39c3f | 2020-08-30 15:52:10 +0200 | [diff] [blame] | 1 | " 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 | |
| 6 | set shortmess+=A |
| 7 | |
| 8 | for name in argv()[1:] |
| 9 | exe 'edit ' .. fnameescape(name) |
| 10 | |
Bram Moolenaar | 65b3486 | 2023-05-10 14:47:50 +0100 | [diff] [blame] | 11 | " Strip comments, also after :set commands. |
Bram Moolenaar | 0b39c3f | 2020-08-30 15:52:10 +0200 | [diff] [blame] | 12 | g/^\s*"/s/.*// |
Bram Moolenaar | 65b3486 | 2023-05-10 14:47:50 +0100 | [diff] [blame] | 13 | g/^\s*set .*"/s/.*// |
Bram Moolenaar | 0b39c3f | 2020-08-30 15:52:10 +0200 | [diff] [blame] | 14 | |
| 15 | " Write as .js file, xgettext recognizes them |
| 16 | exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js" |
| 17 | endfor |
| 18 | |
| 19 | quit |