view src/po/tojavascript.vim @ 33729:9a846ba607bb

runtime(wget): Update for Wget2 2.1.0 (#13497) Commit: https://github.com/vim/vim/commit/d56f15caf602a061f5f9f0a3c6a4537ab2dc6acc Author: dkearns <dougkearns@gmail.com> Date: Thu Nov 9 06:53:20 2023 +1100 runtime(wget): Update for Wget2 2.1.0 (https://github.com/vim/vim/issues/13497) Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Nov 2023 21:00:08 +0100
parents 695b50472e85
children 04563887d70e
line wrap: on
line source

" 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, also after :set commands.
  g/^\s*"/s/.*//
  g/^\s*set .*"/s/.*//

  " Write as .js file, xgettext recognizes them
  exe 'w! ' .. fnamemodify(name, ":t:r") .. ".js"
endfor

quit