--- ./runtime/syntax/po.vim.orig 2004-11-19 15:34:55.000000000 +0100 +++ ./runtime/syntax/po.vim 2005-10-17 17:32:00.000000000 +0200 @@ -1,6 +1,7 @@ " Vim syntax file " Language: po (gettext) " Maintainer: Dwayne Bailey <dwayne@translate.org.za> +" Patchedby: Sung-Hyun Nam <namsh@kldp.org> " Last Change: 2008 Jan 08 " Contributors: Dwayne Bailey (Most advanced syntax highlighting) " Leonardo Fontenelle (Spell checking) @@ -133,3 +134,83 @@ let b:current_syntax = "po" " vim:set ts=8 sts=2 sw=2 noet: + +" +" ########### +" + + +" po.vimrc: VIM resource for 'po' file editing. + +set com= +set path=.,..,../src,, + +" find a non-translated msg string +nmap,fm :call FindNonTransMsg()<CR>z. +imap<C-G> <ESC>:call FindNonTransMsg()<CR>z.$i + +" find fuzzy and remove +nmap,ff :call FindFuzzyErase()<CR> + +" duplicate the original msg. +nmap,fd }?^msgstr<CR>f"ld}?^msgid<CR>f"ly/^msgstr<CR>nf"pNf"l + +" erase the translated message +nmap,fe }?^msgstr<CR>f"lc}"<ESC> + +" perform language dependent checks on strings +nmap,fc :!msgfmt --check %<CR> + +" show statistics +nmap,fs :!msgfmt --statistics %<CR> + +" commit current file +nmap,ci :!cvs ci -m '' %<LEFT><LEFT><LEFT> + +" goto file which contains the current string +nmap,gf {/^#: <CR>02f:l"aye0f w<C-W><C-F>:<C-R>a<CR> + +function! FindNonTransMsg() + let lnum = line(".") + 1 + let enum = line("$") + let found = 0 + while lnum < enum + let line = getline(lnum) + let lnum = lnum + 1 + if line == "msgstr \"\"" + let blank = getline(lnum) + if blank == "" + let found = found + 1 + exec "normal " . lnum . "ggk" + let lnum = enum + endif + let lnum = lnum + 1 + endif + endwhile + if found < 1 + echo "Cannot find non-translated msg" + endif +endfun + +func! FindFuzzyErase() + let lnum = line(".") + 1 + let enum = line("$") + while lnum < enum + let line = getline(lnum) + if line =~ "#, fuzzy" + exec "normal " .lnum. "gg" + if line =~ "#, fuzzy, " + exec "normal ^ldt," + else + exec "normal dd" + endif + /^msgstr + exec "norm z.f\"l" + echohl WarningMsg | echo "You may want to edit this" | echohl None + return + endif + let lnum = lnum + 1 + endwhile + echo "There's no fuzzy" +endfun +