https://bugzilla.wikimedia.org/show_bug.cgi?id=58429

--- Comment #11 from Quim Gil <q...@wikimedia.org> ---
I'm not a HTML/CSS ninja, but let me share this hypothesis anyway:

Bug 44328 - Replace outdated translations with source text on translation pages

The problem reported:

"When a section of a translated page is fuzzied, it is enclosed in spans with
the id mw-translate-fuzzy. Currently these span tags have a line break after
the <span> and before the </span> in wikitext. This breaks line-sensitive
wikimarkup, such as lists."

The wikitext txt attached shows line breaks:

* {{anchor|Triplet}}<span class="mw-translate-fuzzy">
'''Triplet''' is how to store data as a single data entry in
[[#Linkeddata|linked data]]. It consists of a ''subject'', a ''predicate'' and
an ''object''. In Wikidata this is approximately ''item'', ''property'' and the
''value'' from the statement.
</span>
*...

That render as <p></p> in the HTML source code, causing the mess in lists and
other elements where in-line span is required.

Now, looking at the patch:

https://gerrit.wikimedia.org/r/#/c/52215/1/resources/css/ext.translate.css

.mw-translate-fuzzy {        
   background-color: #FDD;        
}

Only background color. Nothing to see here.


https://gerrit.wikimedia.org/r/#/c/52215/1/tag/PageTranslationHooks.php

746    »       »       »       if ( $fuzzy ) {        
747    »       »       »       »       // Only show if there is fuzzy messages  
748    »       »       »       »       $wrap = '<div
class="mw-translate-page-info mw-translate-fuzzy">$1</
div>';        
749    »       »       »       »       $wgOut->wrapWikiMsg( $wrap, array(
'tpt-translation-intro-fuzzy' ) )
;

Alright, the fuzzy string is wrapped by a <div></div>. A div is a block level
element, it is designed to create blocks by default. Perhaps the "<span> + line
break" in wikitext is the interpretation of the "<div>" done by MediaWiki,
resulting in "<p>" when it is rendered to HTML again?

Is there a need to wrap the fuzzy strings with <div>? Why not doing it with
<span> directly, which is an inline element with the same functionality as
<div>? If <div> must be used for some reason, it is possible to specify
"display:inline;" in the CSS, and it should work.

Could someone test what happens when you revert the patch, changing the line
748 to define a span instead of a div? (sorry, I'm not a git ninja either)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to