Spotting fuzzy difference in large html block

Oliver Kellogg olivermkellogg at gmail.com
Sun Nov 5 14:49:14 GMT 2023


Admittedly, I guess it depends on what tools you are used to.
You may find `kompare` of the two xml fragments, or of the xml diff saved
to file, easier to read.
You should make your terminal very wide for reading these diffs, otherwise
indeed nothing is gained.

On Sun, Nov 5, 2023 at 3:15 PM Łukasz Wojniłowicz <
lukasz.wojnilowicz at gmail.com> wrote:

> I used poprettyxml.sh, and it's hardly any help in this case. I get a
> 5107 vs. 5326 letters file to analyse. Granted that the changes are
> visible, but still not easy to analyse. See for yourself
>
> --- fuzzy.xml   2023-11-04 14:34:52.815041559 +0100
> +++ new.xml     2023-11-04 14:35:01.842838827 +0100
> @@ -7,12 +7,21 @@
>        <li style=" margin-top:12px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %f</span>
> or <span style=" font-weight:704;">%filename</span>: The name of the
> .esq file, without extension.</li> <li style=" margin-top:0px;
> margin-bottom:0px; margin-left:0px; margin-right:0px;
> -qt-block-indent:0; text-indent:0px;">Placeholder<span style="
> font-weight:704;"> %D</span> or <span style="
> font-weight:704;">%Datetime</span>: The current time and date <span
> style=" font-weight:704;">when the file is saved.</span></li> <li
> style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %T</span>
> or <span style=" font-weight:704;">%Type</span>: The frame type eg:
> 'Light', 'Bias', 'Dark', 'Flat'...</li>
> -      <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %e</span>
> or <span style=" font-weight:704;">%exposure</span>: The exposure
> duration in seconds.</li>
> +      <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %e</span>
> or <span style=" font-weight:704;">%exposure</span>: The exposure
> duration in seconds, with '_secs' as suffix.</li>
> +      <ul style="margin-top: 0px; margin-bottom: 0px; margin-left:
> 0px; margin-right: 0px; -qt-list-indent: 1;">
> +        <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %E</span>
> or <span style=" font-weight:704;">%exp</span>: The exposure duration
> in seconds as plain number, without any unit as suffix.</li>
> +      </ul>
>        <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %F</span>
> or <span style=" font-weight:704;">%Filter</span>: The active filter
> name.</li> <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;"> %t</span>
> or <span style=" font-weight:704;">%target</span>: The Target
> name.</li> <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder <span style=" font-weight:600;">%C</span>
> or <span style=" font-weight:600;">%temperature</span>: The camera
> temperature of capturing.</li>
> -      <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0; text-indent:0px;">Placeholder
> <span style=" font-weight:600;">%G</span> or <span style="
> font-weight:600;">%gain</span>: The gain configured for capturing.</li>
> +      <ul style="margin-top: 0px; margin-bottom: 0px; margin-left:
> 0px; margin-right: 0px; -qt-list-indent: 1;">
> +        <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder <span style=" font-weight:600;">%B</span>
> or <span style=" font-weight:600;">%bin</span>: The binning configured
> for capturing.</li>
> +        <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder <span style=" font-weight:600;">%G</span>
> or <span style=" font-weight:600;">%gain</span>: The gain configured
> for capturing.</li>
> +      </ul>
>        <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0; text-indent:0px;">Placeholder
> <span style=" font-weight:600;">%O</span> or <span style="
> font-weight:600;">%offset</span>: The offset configured for
> capturing.</li>
> +      <ul style="margin-top: 0px; margin-bottom: 0px; margin-left:
> 0px; margin-right: 0px; -qt-list-indent: 1;">
> +        <li style=" margin-top:0px; margin-bottom:0px;
> margin-left:0px; margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder <span style=" font-weight:600;">%I</span>
> or <span style=" font-weight:600;">%iso</span>: The ISO value (DSLRs
> only).</li>
> +      </ul>
>        <li style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0; text-indent:0px;">Placeholder
> <span style=" font-weight:600;">%P</span> or <span style="
> font-weight:600;">%pierside</span>: The current mount's pier side.</li>
> <li style=" margin-top:0px; margin-bottom:12px; margin-left:0px;
> margin-right:0px; -qt-block-indent:0;
> text-indent:0px;">Placeholder<span style=" font-weight:704;">
> %s*</span> or <span style=" font-weight:704;">%sequence</span>: The
> image sequence identifier where * is the number of digits used (1-9).
> <span style=" font-weight:704;">This tag is mandatory and must be the
> last element in the format.</span></li> </ul>
>
>
> On Sat, 4 Nov 2023 14:07:40 +0100
> Oliver Kellogg <olivermkellogg at gmail.com> wrote:
>
> > While `lokalize` does help a little, I made a little script that
> > eases the pain some more, see below.
> >
> > Usage:
> > * Copy/paste the po-file hunk following the ", fuzzy" line to a file,
> > e.g. fuzzy.txt
> > * Copy/paste the po-file hunk following the msgid "" line to another
> > file, e.g. new.txt
> > * poprettyxml.sh fuzzy.txt > fuzzy.xml
> > * poprettyxml.sh new.txt > new.xml
> > * diff -u fuzzy.xml new.xml
> >
> > The output from the `diff` shows what's going on in a more readable
> > format.
> >
> > -Oliver
> >
> > #!/bin/bash
> > #
> > # poprettyxml.sh
> > # Pretty print GNU gettext PO-file msgid or msgstr which contains XML
> > #
> > # Usage:
> > # Copy/paste the text following ", fuzzy" or following msgid ""
> > # to a separate file and provide this file as argument.
> > #
> > # Copyright (C) 2023 Oliver Kellogg <okellogg at users.sourceforge.net>
> > # Distributable under the MIT license
> > https://opensource.org/license/mit/ #
> >
> > pofrag=$1
> > tmpfile=pretty.tmp
> >
> > sed 's/^#*|* *"//; s/"$//; s/\\"/"/g' $pofrag | tr -d '\n' > $tmpfile
> > echo >> $tmpfile
> > haveHtmlDecl=$(grep '<html>' $tmpfile)
> > if [ -z "$haveHtmlDecl" ]; then
> >  sed -e '1i <html><body>' -e '$a </body></html>' -i $tmpfile
> > fi
> > cat $tmpfile | xmllint --format -
> >
> > rm -f $tmpfile
> >
> >
> >
> >
> > On Mon, Jul 3, 2023 at 9:49 PM Łukasz Wojniłowicz <
> > lukasz.wojnilowicz at gmail.com> wrote:
> >
> > > I am of the same opinion. Maybe the maintainer of KStars isn't
> > > aware of that, and would find feedback from the translators useful,
> > > so CCing.
> > >
> > > On Wed, 28 Jun 2023 11:49:39 +0200
> > > Karl Ove Hufthammer <karl at huftis.org> wrote:
> > >
> > > > Yuri Chornoivan skreiv 28.06.2023 07:44:
> > > > >> ... And all that just to find:
> > > > >> The only difference between the two large hunks was a one
> > > > >> character typo fix, "encapulates" -> "encapsulates"
> > > > >> at original line:
> > > > >> #| "circle centred on the star centroid that encapulates half
> > > > >> the star's flux."
> > > > >>
> > > > >> Is there an easier way to find the difference(s)?
> > > > > Hi,
> > > > >
> > > > > I use Lokalize and it shows the diffrences immediately.
> > > >
> > > > I also recommend using Lokalize. The built-in coloured diff
> > > > feature is very useful. See attached screenshot (if it is
> > > > accepted by the mailing list). I could not imagine doing
> > > > translation work without such a feature.
> > > >
> > > > But these complicated HTML strings (with full HTML headers, lots
> > > > of style attributes &c.) are annoying. I think they’re
> > > > automatically generated by Qt Designer if you’re not careful.
> > > >
> > > >
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-i18n-doc/attachments/20231105/5160f7c4/attachment-0001.htm>


More information about the kde-i18n-doc mailing list