Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/52215


Change subject: (bug 44328) Do not display fuzzy translations on translation 
pages
......................................................................

(bug 44328) Do not display fuzzy translations on translation pages

Bug: 44328
Change-Id: I8ff927f9dbd89ee312ddb778df5d6fe804d86ca2
---
M PageTranslation.i18n.php
M resources/css/ext.translate.css
M tag/PageTranslationHooks.php
M tag/RenderJob.php
M tag/TPParse.php
5 files changed, 5 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/15/52215/1

diff --git a/PageTranslation.i18n.php b/PageTranslation.i18n.php
index 468c450..f53b898 100644
--- a/PageTranslation.i18n.php
+++ b/PageTranslation.i18n.php
@@ -89,7 +89,6 @@
        'translate-tag-markthisagain' => 'This page has <span 
class="plainlinks">[$1 changes]</span> since it was last <span 
class="plainlinks">[$2 marked for translation]</span>.',
        'translate-tag-hasnew' => 'This page contains <span 
class="plainlinks">[$1 changes]</span> which are not marked for translation.',
        'tpt-translation-intro' => 'This page is a <span class="plainlinks">[$1 
translated version]</span> of a page [[$2]] and the translation is $3% 
complete.',
-       'tpt-translation-intro-fuzzy' => 'Outdated translations are marked like 
this.',
 
        'tpt-languages-legend' => 'Other languages:',
        'tpt-languages-separator' => '&#160;•&#160;',
diff --git a/resources/css/ext.translate.css b/resources/css/ext.translate.css
index b88614d..a321463 100644
--- a/resources/css/ext.translate.css
+++ b/resources/css/ext.translate.css
@@ -1,7 +1,3 @@
-.mw-translate-fuzzy {
-       background-color: #FDD;
-}
-
 .mw-translate-page-info {
        font-size: x-small;
        text-align: center;
diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php
index 5423138..3084bd4 100644
--- a/tag/PageTranslationHooks.php
+++ b/tag/PageTranslationHooks.php
@@ -739,17 +739,6 @@
                $wrap = '<div class="mw-translate-page-info">$1</div>';
                $wgOut->wrapWikiMsg( $wrap, array( 'tpt-translation-intro', 
$url, $titleText, $per ) );
 
-               if ( floor( $per ) < 100 ) {
-                       $groupId = $page->getMessageGroup()->getId();
-                       $stats = MessageGroupStats::forItem( $groupId, $code );
-                       $fuzzy = $stats[MessageGroupStats::FUZZY];
-                       if ( $fuzzy ) {
-                               // Only show if there is fuzzy messages
-                               $wrap = '<div class="mw-translate-page-info 
mw-translate-fuzzy">$1</div>';
-                               $wgOut->wrapWikiMsg( $wrap, array( 
'tpt-translation-intro-fuzzy' ) );
-                       }
-               }
-
                $wgOut->addHTML( '<hr />' );
        }
 
diff --git a/tag/RenderJob.php b/tag/RenderJob.php
index d428d04..d26cd99 100644
--- a/tag/RenderJob.php
+++ b/tag/RenderJob.php
@@ -49,7 +49,6 @@
 
                $group = $page->getMessageGroup();
                $collection = $group->initCollection( $code );
-               $collection->loadTranslations( DB_MASTER );
 
                $text = $page->getParse()->getTranslationPageText( $collection 
);
 
diff --git a/tag/TPParse.php b/tag/TPParse.php
index 0200e46..84a298d 100644
--- a/tag/TPParse.php
+++ b/tag/TPParse.php
@@ -165,10 +165,8 @@
        }
 
        /**
-        * Returns translation page with all possible translations replaced in, 
ugly
-        * translation tags removed and outdated translation marked with a class
-        * mw-translate-fuzzy.
-        * @todo The class marking has to be more intelligent with span&div use.
+        * Returns translation page with all possible translations replaced in
+        * and ugly translation tags removed.
         * @param MessageCollection $collection Collection that holds 
translated messages.
         * @return string Whole page as wikitext.
         */
@@ -179,8 +177,8 @@
                $prefix = $this->title->getPrefixedDBKey() . '/';
 
                if ( $collection instanceof MessageCollection ) {
-                       $collection->filter( 'hastranslation', false );
-                       $collection->loadTranslations();
+                       $collection->filter( 'translated', false );
+                       $collection->loadTranslations( DB_MASTER );
                }
 
                foreach ( $this->sections as $ph => $s ) {
@@ -191,16 +189,7 @@
                                 * @var TMessage $msg
                                 */
                                $msg = $collection[$prefix . $s->id];
-                               $translation = $msg->translation();
-
-                               if ( $translation !== null ) {
-                                       // Ideally we should not have fuzzy 
here, but old texts do
-                                       $sectiontext = str_replace( 
TRANSLATE_FUZZY, '', $translation );
-
-                                       if ( $msg->hasTag( 'fuzzy' ) ) {
-                                               $sectiontext = "<span 
class=\"mw-translate-fuzzy\">\n$sectiontext\n</span>";
-                                       }
-                               }
+                               $sectiontext = $msg->translation();
                        }
 
                        // Use the original text if no translation is available

-- 
To view, visit https://gerrit.wikimedia.org/r/52215
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ff927f9dbd89ee312ddb778df5d6fe804d86ca2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to