Wednesday, June 30, 2010

Re: vimdiff-like highlighting within the same file?

On Wed, June 30, 2010 11:59 am, Andrei Popescu wrote:
> What I posted was an excerpt of a .po file. Here is a full "string" with
> comments:
>
> [blank line]
> #. Type: select
> #. Description
> #. :sl5:
> #: ../s390-dasd.templates:1002
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ other stuff, not interesting in this case
> #, fuzzy
> ^^^^^^^^ fuzzy flag, indicates the original (usually English) msgid
> (string) has changed
> #| msgid ""
> #| "The following disk access storage devices (DASD) are available. Please
> "
> #| "select each device you want to use one at a time."
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ old English msgid
> msgid ""
> "The following direct access storage devices (DASD) are available. Please
> "
> "select each device you want to use one at a time."
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new English msgid
> msgstr ""
> "Următoarele Dispozitive de stocare cu acces la disc (DASD) sunt
> disponibile. "
> "Vă rugăm să alegeți pe rând fiecare dispozitiv pe care doriți să-l
> folosiți."
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ translation
> [blank line]
>
> "strings" are always separated by (at least) one blank line and a .po
> file usually contains a lot of them (hundreds or more), which is why I
> won't post a complete file. A translator must not, ever, touch the
> "other stuff" and the current msgid.
>
> After editing the translation the fuzzy flag must be removed to indicate
> the translation is ok (handled by po.vim) and the previous msgid becomes
> useless and is removed as well (I have a patch for po.vim).
>
> It would be of great help to the translator to have the differences
> between the previous and current msgid highlighted, especially in long
> strings with only small changes.

Thanks, that makes it clearer to me.

I would use the NarrowRegion plugin[1]. Make sure, it uses vertical
split windows, (:let g:nrrw_rgn_vert = 1), set nowinfixwidth in each
narrowed window (:set nowinfixwidth), resize each window to your desired
width and diff each narrowed window (:diffthis). You can then
interactively merge the differences (see :h copy-diff) and when
finished, simply write the Narrowed window. Be sure to read the
documentation of the plugin (:h NrrwRgn.txt)

But then again, I am a little bit biased, as I am the author of the
plugin and there might be better ways to do it.

[1] http://www.vim.org/scripts/script.php?script_id=3075

regards,
Christian

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: