Wednesday, June 30, 2010

Re: vimdiff-like highlighting within the same file?

On Mi, 30 iun 10, 11:12:03, Christian Brabandt wrote:
> On Wed, June 30, 2010 10:52 am, Andrei Popescu wrote:
> > I'm trying to add new features to vim's handling of .po files. How could
> > I highlight the differences between the current msgid and the previous
> > one?
>
> I don't understand your question. Can you elaborate, on what the file
> looks like and where the previous message id comes from? Please show a
> sample file, with which we can see your problem.

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.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)

No comments: