Your message dated Thu, 27 Mar 2025 22:03:15 -0400
with message-id
<eyotfk2pkwqfc2p2etqrzzx2or7exltfswrujxqetf6hhiapde@qtuzr3oxdgdr>
and subject line Re: Bug#611544: ftplugin/po.vim: Patch to enhance handling of
fuzzy strings with --previous msgid in po files
has caused the Debian Bug report #611544,
regarding ftplugin/po.vim: Patch to enhance handling of fuzzy strings with
--previous msgid in po files
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
611544: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611544
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: vim-scripts
Version: 20091011
Severity: wishlist
Tags: patch
Hello,
I tried to contact the upstream author regarding this patch, but I got
no response. The diff part needs more work.
[sniped irrelevant system info]
Thanks,
Andrei
--- /usr/share/vim-scripts/ftplugin/po.vim 2009-10-11 19:24:05.000000000
+0300
+++ .vim/ftplugin/po.vim 2011-01-30 17:39:35.000000000 +0200
@@ -1,8 +1,8 @@
" Vim ftplugin for PO file (GNU gettext) editing.
" Maintainer: Aleksandar Jelenak <ajelenak AT yahoo.com>
-" Last Change: Tue, 12 Apr 2005 13:49:55 -0400
+" Last Change: Tue, 30 Jan 2011 17:25:32 +0200
"
-" *** Latest version: http://www.vim.org/scripts/script.php?script_id=695 ***
+" *** Based on the version at:
http://www.vim.org/scripts/script.php?script_id=695 ***
"
" DESCRIPTION
" This file is a Vim ftplugin for editing PO files (GNU gettext -- the GNU
@@ -19,7 +19,7 @@
" Move to the next fuzzy translation <S-F5> \f
" Move to the previous fuzzy translation <S-F6> \b
" Label the translation fuzzy <S-F7> \z
-" Remove the fuzzy label <S-F8> \r
+" Remove the fuzzy label and previous msgid <S-F8> \r
" Show msgfmt statistics for the file(*) <S-F11> \s
" Browse through msgfmt errors for the file(*) <S-F12> \e
" Put the translator info in the header \t \t
@@ -36,7 +36,7 @@
" Move to the next fuzzy translation <S-F5> \f
" Move to the previous fuzzy translation <S-F6> \b
" Label the translation fuzzy <S-F7> \z
-" Remove the fuzzy label <S-F8> \r
+" Remove the fuzzy label and previous msgid <S-F8> \r
" Split-open the file under cursor gf gf
" Show msgfmt statistics for the file(*) <S-F11> \s
" Browse through msgfmt errors for the file(*) <S-F12> \e
@@ -45,6 +45,10 @@
" ---------------------------------------------------------------
" (*) Only available on UNIX computers.
"
+" Command
+" ===============================================================
+" Use a hidden buffer to highlight changes :DiffMsgid
+"
" Remarks:
" - "S" in the above key mappings stands for the <Shift> key and "\" in
" fact means "<LocalLeader>" (:help <LocalLeader>), which is "\" by
@@ -69,6 +73,10 @@
" program via the global variable 'g:po_msgfmt_args'. All arguments are
" allowed except the "-o" for output file. The default value is
" "-vv -c".
+" - The :DiffMsgid command works only if --previous was used with msgmerge
+" (or equivalent options in other .po tools).
+" TODO
+" The substitute does not work for strings that are only one line
"
" But there's even more!
"
@@ -212,7 +220,7 @@
endwhile
endf
-" Remove fuzzy description from the translation.
+" Remove previous msgid and fuzzy flag.
if !hasmapto('<Plug>RemoveFuzzy')
if gui
imap <buffer> <unique> <S-F8> <Plug>RemoveFuzzy
@@ -222,16 +230,12 @@
nmap <buffer> <unique> <LocalLeader>r <Plug>RemoveFuzzy
endif
endif
-inoremap <buffer> <unique> <Plug>RemoveFuzzy <ESC>{vap:call
<SID>RemoveFuzzy()<CR>i
-nnoremap <buffer> <unique> <Plug>RemoveFuzzy {vap:call <SID>RemoveFuzzy()<CR>
+inoremap <buffer> <unique> <Plug>RemoveFuzzy <ESC>{vap:call
<SID>RemoveFuzzy()<CR>gv<ESC>}i
+nnoremap <buffer> <unique> <Plug>RemoveFuzzy {vap:call
<SID>RemoveFuzzy()<CR>gv<ESC>}
-fu! <SID>RemoveFuzzy()
- let line = getline(".")
- if line =~ '^#,\s*fuzzy$'
- exe "normal! dd"
- elseif line =~ '^#,\(.*,\)\=\s*fuzzy'
- exe 's/,\s*fuzzy//'
- endif
+fu! <SID>RemoveFuzzy() range
+ execute ':''<,''>global/^#,\sfuzzy$\|^#|\s.*".*"$/d'
+ execute ':''<,''>s/,\s*fuzzy//e'
endf
" Show PO translation statistics. (Only available on UNIX computers for now.)
@@ -404,4 +408,33 @@
endif
endf
+" This copies everything to a new, hidden buffer, so we can use the builtin
+" diff capabilities of vim. Built on an idea of Jürgen Krämer from the vim
+" users mailing list
+fu! DiffPreviousString()
+ %yank
+ new
+ put!
+ " this replaces the current msgid with the old one, so that diff
+ " can highlight the changes. Currently doesn't work with
+ " msgids that are only in one (the first) line
+ " example:
+ " ------------------------
+ " #, fuzzy
+ " #| msgid "previous text"
+ " msgid "new text"
+ " msgstr "translation"
+ "
+ " ------------------------
+ %s/^\(#| msgid ""\n\(\_.\{-\}\n\)msgid ""\n\)\(\_.\{-\}\n\)\(msgstr
""\)/\=submatch(1).substitute(submatch(2), '#| ', '', 'g').submatch(4)/
+ nohls
+ diffthis
+ hide
+ diffthis
+ set fdc=0
+ set nofen
+endf
+
+command DiffMsgid call DiffPreviousString()
+
unlet gui
--- End Message ---
--- Begin Message ---
On Sun, Jan 30, 2011 at 05:46:49PM +0200, Andrei POPESCU wrote:
I tried to contact the upstream author regarding this patch, but I got
no response. The diff part needs more work.
This script is being removed from the package, since it doesn't have any
declared license and the upstream author isn't reachable.
Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB
--- End Message ---