r60611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60610‎ | r60611 | r60612 >
Date:18:48, 4 January 2010
Author:catrope
Status:deferred
Tags:
Comment:
wmf-deployment: Merging GlobalUsage up to trunk state
Modified paths:
  • /branches/wmf-deployment/extensions/GlobalUsage (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/ApiQueryGlobalUsage.php (added) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.pg.sql (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.sql (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageHooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageQuery.php (added) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage_body.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/SpecialGlobalUsage.php (modified) (history)
  • /branches/wmf-deployment/extensions/GlobalUsage/refreshGlobalimagelinks.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageHooks.php
@@ -1,22 +1,40 @@
22 <?php
33 class GlobalUsageHooks {
44 private static $gu = null;
5 -
 5+
66 /**
77 * Hook to LinksUpdateComplete
88 * Deletes old links from usage table and insert new ones.
99 */
1010 public static function onLinksUpdateComplete( $linksUpdater ) {
1111 $title = $linksUpdater->getTitle();
12 -
 12+
1313 // Create a list of locally existing images
1414 $images = array_keys( $linksUpdater->getImages() );
1515 $localFiles = array_keys( RepoGroup::singleton()->getLocalRepo()->findFiles( $images ) );
16 -
 16+ $missingFiles = array_diff( $images, $localFiles );
 17+
 18+ global $wgUseDumbLinkUpdate;
1719 $gu = self::getGlobalUsage();
18 - $gu->deleteFrom( $title->getArticleId( GAID_FOR_UPDATE ) );
19 - $gu->setUsage( $title, array_diff( $images, $localFiles ) );
20 -
 20+ if ( $wgUseDumbLinkUpdate ) {
 21+ // Delete all entries to the page
 22+ $gu->deleteLinksFromPage( $title->getArticleId( GAID_FOR_UPDATE ) );
 23+ // Re-insert new usage for the page
 24+ $gu->insertLinks( $title, $missingFiles );
 25+ } else {
 26+ $articleId = $title->getArticleId( GAID_FOR_UPDATE );
 27+ $existing = $gu->getLinksFromPage( $articleId );
 28+
 29+ // Calculate changes
 30+ $added = array_diff( $missingFiles, $existing );
 31+ $removed = array_diff( $existing, $missingFiles );
 32+
 33+ // Add new usages and delete removed
 34+ $gu->insertLinks( $title, $added );
 35+ if ( $removed )
 36+ $gu->deleteLinksFromPage( $articleId, $removed );
 37+ }
 38+
2139 return true;
2240 }
2341 /**
@@ -36,9 +54,9 @@
3755 public static function onArticleDeleteComplete( $article, $user, $reason, $id ) {
3856 $title = $article->getTitle();
3957 $gu = self::getGlobalUsage();
40 - $gu->deleteFrom( $id );
 58+ $gu->deleteLinksFromPage( $id );
4159 if ( $title->getNamespace() == NS_FILE ) {
42 - $gu->copyFromLocal( $title );
 60+ $gu->copyLocalImagelinks( $title );
4361 }
4462 return true;
4563 }
@@ -47,9 +65,9 @@
4866 * Hook to FileUndeleteComplete
4967 * Deletes the file from the global link table.
5068 */
51 - public static function onFileUndeleteComplete( $title, $versions, $user, $reason ) {
 69+ public static function onFileUndeleteComplete( $title, $versions, $user, $reason ) {
5270 $gu = self::getGlobalUsage();
53 - $gu->deleteTo( $title );
 71+ $gu->deleteLinksToFile( $title );
5472 return true;
5573 }
5674 /**
@@ -58,23 +76,22 @@
5977 */
6078 public static function onUploadComplete( $upload ) {
6179 $gu = self::getGlobalUsage();
62 - $gu->deleteTo( $upload->getTitle() );
 80+ $gu->deleteLinksToFile( $upload->getTitle() );
6381 return true;
6482 }
65 -
 83+
6684 /**
6785 * Initializes a GlobalUsage object for the current wiki.
6886 */
6987 private static function getGlobalUsage() {
7088 global $wgGlobalUsageDatabase;
7189 if ( is_null( self::$gu ) ) {
72 - self::$gu = new GlobalUsage( wfWikiId(),
73 - wfGetDB( DB_MASTER, array(), $wgGlobalUsageDatabase )
 90+ self::$gu = new GlobalUsage( wfWikiId(),
 91+ wfGetDB( DB_MASTER, array(), $wgGlobalUsageDatabase )
7492 );
7593 }
76 -
 94+
7795 return self::$gu;
7896 }
79 -
8097
8198 }
\ No newline at end of file
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageQuery.php
@@ -0,0 +1,163 @@
 2+<?php
 3+/**
 4+ * A helper class to query the globalimagelinks table
 5+ *
 6+ * Should maybe simply resort to offset/limit query rather
 7+ */
 8+class GlobalUsageQuery {
 9+ private $limit = 50;
 10+ private $offset = 0;
 11+ private $hasMore = false;
 12+ private $filterLocal = false;
 13+ private $result;
 14+ private $continue;
 15+
 16+
 17+ public function __construct( $target ) {
 18+ global $wgGlobalUsageDatabase;
 19+ $this->db = wfGetDB( DB_SLAVE, array(), $wgGlobalUsageDatabase );
 20+ if ( $target instanceof Title )
 21+ $this->target = $target->getDBKey();
 22+ else
 23+ $this->target = $target;
 24+ $this->offset = array( '', '', '' );
 25+
 26+ }
 27+
 28+ /**
 29+ * Set the offset parameter
 30+ *
 31+ * @param $offset int offset
 32+ */
 33+ public function setOffset( $offset ) {
 34+ if ( !is_array( $offset ) )
 35+ $offset = explode( '|', $offset );
 36+
 37+ if ( count( $offset ) == 3 ) {
 38+ $this->offset = $offset;
 39+ return true;
 40+ } else {
 41+ return false;
 42+ }
 43+ }
 44+ /**
 45+ * Return the offset set by the user
 46+ *
 47+ * @return array offset
 48+ */
 49+ public function getOffsetString() {
 50+ return implode( '|', $this->offset );
 51+ }
 52+ /**
 53+ *
 54+ */
 55+ public function getContinueString() {
 56+ return "{$this->lastRow->gil_to}|{$this->lastRow->gil_wiki}|{$this->lastRow->gil_page}";
 57+ }
 58+
 59+ /**
 60+ * Set the maximum amount of items to return. Capped at 500.
 61+ *
 62+ * @param $limit int The limit
 63+ */
 64+ public function setLimit( $limit ) {
 65+ $this->limit = min( $limit, 500 );
 66+ }
 67+ public function getLimit() {
 68+ return $this->limit;
 69+ }
 70+
 71+ /**
 72+ * Set whether to filter out the local usage
 73+ */
 74+ public function filterLocal( $value = true ) {
 75+ $this->filterLocal = $value;
 76+ }
 77+
 78+
 79+ /**
 80+ * Executes the query
 81+ */
 82+ public function execute() {
 83+ $where = array( 'gil_to' => $this->target );
 84+ if ( $this->filterLocal )
 85+ $where[] = 'gil_wiki != ' . $this->db->addQuotes( wfWikiId() );
 86+
 87+ $qTo = $this->db->addQuotes( $this->offset[0] );
 88+ $qWiki = $this->db->addQuotes( $this->offset[1] );
 89+ $qPage = intval( $this->offset[2] );
 90+
 91+ $where[] = "(gil_to > $qTo) OR " .
 92+ "(gil_to = $qTo AND gil_wiki > $qWiki) OR " .
 93+ "(gil_to = $qTo AND gil_wiki = $qWiki AND gil_page >= $qPage )";
 94+
 95+
 96+ $res = $this->db->select( 'globalimagelinks',
 97+ array(
 98+ 'gil_to',
 99+ 'gil_wiki',
 100+ 'gil_page',
 101+ 'gil_page_namespace',
 102+ 'gil_page_title'
 103+ ),
 104+ $where,
 105+ __METHOD__,
 106+ array(
 107+ 'ORDER BY' => 'gil_to, gil_wiki, gil_page',
 108+ 'LIMIT' => $this->limit + 1,
 109+ )
 110+ );
 111+
 112+ $count = 0;
 113+ $this->hasMore = false;
 114+ $this->result = array();
 115+ foreach ( $res as $row ) {
 116+ $count++;
 117+ if ( $count > $this->limit ) {
 118+ $this->hasMore = true;
 119+ $this->lastRow = $row;
 120+ break;
 121+ }
 122+
 123+ if ( !isset( $this->result[$row->gil_to] ) )
 124+ $this->result[$row->gil_to] = array();
 125+ if ( !isset( $this->result[$row->gil_to][$row->gil_wiki] ) )
 126+ $this->result[$row->gil_to][$row->gil_wiki] = array();
 127+
 128+ $this->result[$row->gil_to][$row->gil_wiki][] = array(
 129+ 'image' => $row->gil_to,
 130+ 'id' => $row->gil_page,
 131+ 'namespace' => $row->gil_page_namespace,
 132+ 'title' => $row->gil_page_title,
 133+ 'wiki' => $row->gil_wiki,
 134+ );
 135+ }
 136+ }
 137+ public function getResult() {
 138+ return $this->result;
 139+ }
 140+ public function getSingleImageResult() {
 141+ if ( $this->result )
 142+ return current( $this->result );
 143+ else
 144+ return array();
 145+ }
 146+
 147+ /**
 148+ * Returns whether there are more results
 149+ *
 150+ * @return bool
 151+ */
 152+ public function hasMore() {
 153+ return $this->hasMore;
 154+ }
 155+
 156+ /**
 157+ * Returns the result length
 158+ *
 159+ * @return int
 160+ */
 161+ public function count() {
 162+ return count( $this->result );
 163+ }
 164+}
Property changes on: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsageQuery.php
___________________________________________________________________
Name: svn:eol-style
1165 + native
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.sql
@@ -1,20 +1,19 @@
2 -CREATE TABLE /*$wgDBprefix*/globalimagelinks (
 2+CREATE TABLE /*_*/globalimagelinks (
33 -- Wiki id
44 gil_wiki varchar(32) not null,
55 -- page_id on the local wiki
66 gil_page int unsigned not null,
77 -- Namespace, since the foreign namespaces may not match the local ones
 8+ gil_page_namespace_id int not null,
89 gil_page_namespace varchar(255) not null,
910 -- Page title
10 - gil_page_title varchar(255) not null,
 11+ gil_page_title varchar(255) binary not null,
1112 -- Image name
12 - gil_to varchar(255) not null,
13 -
14 -
15 - -- Note: You might want to shorten the gil_wiki part of the indices.
16 - -- If the domain format is used, only the "en.wikip" part is needed for an
17 - -- unique lookup
18 -
19 - PRIMARY KEY (gil_to, gil_wiki, gil_page),
20 - INDEX (gil_wiki, gil_page)
 13+ gil_to varchar(255) binary not null
2114 ) /*$wgDBTableOptions*/;
 15+
 16+CREATE UNIQUE INDEX globalimagelinks_to_wiki_page
 17+ ON /*_*/globalimagelinks (gil_to, gil_wiki, gil_page);
 18+CREATE INDEX globalimagelinks_wiki
 19+ ON /*_*/globalimagelinks (gil_wiki, gil_page);
 20+
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.pg.sql
@@ -1,6 +1,7 @@
22 CREATE TABLE globalimagelinks (
33 gil_wiki TEXT NOT NULL,
44 gil_page INTEGER NOT NULL,
 5+ gil_page_namespace_id INTEGER NOT NULL,
56 gil_page_namespace TEXT NOT NULL,
67 gil_page_title TEXT NOT NULL,
78 gil_to TEXT NOT NULL,
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage_body.php
@@ -6,7 +6,7 @@
77
88 /**
99 * Construct a GlobalUsage instance for a certain wiki.
10 - *
 10+ *
1111 * @param $interwiki string Interwiki prefix of the wiki
1212 * @param $db mixed Database object
1313 */
@@ -14,19 +14,20 @@
1515 $this->interwiki = $interwiki;
1616 $this->db = $db;
1717 }
18 -
 18+
1919 /**
2020 * Sets the images used by a certain page
21 - *
 21+ *
2222 * @param $title Title Title of the page
2323 * @param $images array Array of db keys of images used
2424 */
25 - public function setUsage( $title, $images, $pageIdFlags = GAID_FOR_UPDATE ) {
 25+ public function insertLinks( $title, $images, $pageIdFlags = GAID_FOR_UPDATE ) {
2626 $insert = array();
2727 foreach ( $images as $name ) {
2828 $insert[] = array(
2929 'gil_wiki' => $this->interwiki,
3030 'gil_page' => $title->getArticleID( $pageIdFlags ),
 31+ 'gil_page_namespace_id' => $title->getNamespace(),
3132 'gil_page_namespace' => $title->getNsText(),
3233 'gil_page_title' => $title->getDBkey(),
3334 'gil_to' => $name
@@ -35,26 +36,46 @@
3637 $this->db->insert( 'globalimagelinks', $insert, __METHOD__ );
3738 }
3839 /**
39 - * Deletes all entries from a certain page
40 - *
41 - * @param $id int Page id of the page
 40+ * Get all global images from a certain page
4241 */
43 - public function deleteFrom( $id ) {
44 - $this->db->delete(
45 - 'globalimagelinks',
 42+ public function getLinksFromPage( $id ) {
 43+ $res = $this->db->select(
 44+ 'globalimagelinks',
 45+ 'gil_to',
4646 array(
4747 'gil_wiki' => $this->interwiki,
48 - 'gil_page' => $id
 48+ 'gil_page' => $id,
4949 ),
50 - __METHOD__
 50+ __METHOD__
5151 );
 52+
 53+ $images = array();
 54+ foreach ( $res as $row )
 55+ $images[] = $row->gil_to;
 56+ return $images;
5257 }
5358 /**
 59+ * Deletes all entries from a certain page to certain files
 60+ *
 61+ * @param $id int Page id of the page
 62+ * @param $to mixed File name(s)
 63+ */
 64+ public function deleteLinksFromPage( $id, $to = null ) {
 65+ $where = array(
 66+ 'gil_wiki' => $this->interwiki,
 67+ 'gil_page' => $id
 68+ );
 69+ if ( $to ) {
 70+ $where['gil_to'] = $to;
 71+ }
 72+ $this->db->delete( 'globalimagelinks', $where, __METHOD__ );
 73+ }
 74+ /**
5475 * Deletes all entries to a certain image
55 - *
 76+ *
5677 * @param $title Title Title of the file
5778 */
58 - public function deleteTo( $title ) {
 79+ public function deleteLinksToFile( $title ) {
5980 $this->db->delete(
6081 'globalimagelinks',
6182 array(
@@ -62,20 +83,20 @@
6384 'gil_to' => $title->getDBkey()
6485 ),
6586 __METHOD__
66 - );
 87+ );
6788 }
68 -
 89+
6990 /**
7091 * Copy local links to global table
71 - *
 92+ *
7293 * @param $title Title Title of the file to copy entries from.
7394 */
74 - public function copyFromLocal( $title ) {
 95+ public function copyLocalImagelinks( $title ) {
7596 global $wgContLang;
76 -
 97+
7798 $dbr = wfGetDB( DB_SLAVE );
78 - $res = $dbr->select(
79 - array( 'imagelinks', 'page' ),
 99+ $res = $dbr->select(
 100+ array( 'imagelinks', 'page' ),
80101 array( 'il_to', 'page_id', 'page_namespace', 'page_title' ),
81102 array( 'il_from = page_id', 'il_to' => $title->getDBkey() ),
82103 __METHOD__
@@ -85,6 +106,7 @@
86107 $insert[] = array(
87108 'gil_wiki' => $this->interwiki,
88109 'gil_page' => $row->page_id,
 110+ 'gil_page_namespace_id' => $row->page_namespace,
89111 'gil_page_namespace' => $wgContLang->getNsText( $row->page_namespace ),
90112 'gil_page_title' => $row->page_title,
91113 'gil_to' => $row->il_to,
@@ -92,7 +114,7 @@
93115 }
94116 $this->db->insert( 'globalimagelinks', $insert, __METHOD__ );
95117 }
96 -
 118+
97119 /**
98120 * Changes the page title
99121 *
@@ -102,7 +124,8 @@
103125 public function moveTo( $id, $title ) {
104126 $this->db->update(
105127 'globalimagelinks',
106 - array(
 128+ array(
 129+ 'gil_page_namespace_id' => $title->getNamespace(),
107130 'gil_page_namespace' => $title->getNsText(),
108131 'gil_page_title' => $title->getText()
109132 ),
@@ -113,9 +136,4 @@
114137 __METHOD__
115138 );
116139 }
117 -
118 -
119 -
120 -
121 -
122140 }
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.i18n.php
@@ -16,7 +16,8 @@
1717 'globalusage-desc' => '[[Special:GlobalUsage|Special page]] to view global file usage',
1818 'globalusage-ok' => 'Search',
1919 'globalusage-text' => 'Search global file usage',
20 - 'globalusage-on-wiki' => 'Usage of [[:File:$1|$1]] on $2',
 20+ 'globalusage-no-results' => '[[:$1]] is not used on other wikis.',
 21+ 'globalusage-on-wiki' => 'Usage on $2',
2122 'globalusage-of-file' => 'The following other wikis use this file:',
2223 'globalusage-more' => 'View [[{{#Special:GlobalUsage}}/$1|more global usage]] of this file.',
2324 'globalusage-filterlocal' => 'Do not show local usage',
@@ -24,11 +25,30 @@
2526
2627 /** Message documentation (Message documentation)
2728 * @author Jon Harald Søby
 29+ * @author Nghtwlkr
2830 * @author Purodha
 31+ * @author Raymond
 32+ * @author Umherirrender
 33+ * @author Vriullop
2934 */
3035 $messages['qqq'] = array(
 36+ 'globalusage-for' => 'Tittel på [[Special:GlobalUsage]]
 37+* $1 - navn på den ettersøkte filen, med navnerom',
3138 'globalusage-desc' => 'Short description of this extension, shown on [[Special:Version]]. Do not translate or change links.',
32 - 'globalusage-ok' => '{{Identical|Search}}',
 39+ 'globalusage-ok' => '{{Identical|Search}}
 40+Button on [[Special:GlobalUsage]]',
 41+ 'globalusage-text' => 'Label on [[Special:GlobalUsage]]',
 42+ 'globalusage-no-results' => 'Brukt for tomme resultat på [[Special:GlobalUsage]]
 43+* $1 - navn på filen (med navnerom)',
 44+ 'globalusage-on-wiki' => 'Vist i listen over global bruk. Eksempel: [[Commons:Special:GlobalUsage/Example.jpg]] og [[Commons:File:Example.jpg]]
 45+
 46+* $1 filnavnet, men ikke brukt i denne meldingen
 47+* $2 prosjektnavnet',
 48+ 'globalusage-of-file' => 'Brukt på en bildeside.
 49+Antallet følgende wikier er ukjent. Ved tomt resultat vises ingen melding.',
 50+ 'globalusage-more' => 'Brukt på en bildeside når flere globale bruksresultat er tilgjengelige. Eksempel: [[Commons:File:Example.jpg]]
 51+* $1 - navn på filen (uten navnerom)',
 52+ 'globalusage-filterlocal' => 'Filtervalg for [[Special:GlobalUsage]]',
3353 );
3454
3555 /** Karelian (Karjala)
@@ -52,6 +72,8 @@
5373 $messages['af'] = array(
5474 'globalusage' => 'Globale lêergebruik',
5575 'globalusage-ok' => 'Soek',
 76+ 'globalusage-no-results' => "[[:$1]] word nie in ander wiki's gebruik nie.",
 77+ 'globalusage-on-wiki' => 'Gebruik in $2',
5678 );
5779
5880 /** Amharic (አማርኛ)
@@ -72,7 +94,11 @@
7395 'globalusage-desc' => '[[Special:GlobalUsage|صفحة خاصة]] لرؤية استخدام الملف العام',
7496 'globalusage-ok' => 'بحث',
7597 'globalusage-text' => 'بحث استخدام الملف العام',
76 - 'globalusage-on-wiki' => 'استخدام [[:File:$1|$1]] في $2',
 98+ 'globalusage-no-results' => '[[:$1]] غير مستخدم في ويكيات أخرى.',
 99+ 'globalusage-on-wiki' => 'الاستخدام في $2',
 100+ 'globalusage-of-file' => 'الويكيات الأخرى التالية تستخدم هذا الملف:',
 101+ 'globalusage-more' => 'عرض [[{{#Special:GlobalUsage}}/$1|المزيد من الاستخدام العام]] لهذا الملف.',
 102+ 'globalusage-filterlocal' => 'لا تعرض الاستخدام المحلي',
77103 );
78104
79105 /** Aramaic (ܐܪܡܝܐ)
@@ -119,17 +145,27 @@
120146 'globalusage-desc' => '[[Special:GlobalUsage|Спэцыяльная старонка]] для прагляду глябальнага выкарыстаньня файла',
121147 'globalusage-ok' => 'Пошук',
122148 'globalusage-text' => 'Пошук глябальнага выкарыстаньня файла.',
123 - 'globalusage-on-wiki' => 'Выкарыстаньне [[:File:$1|$1]] у $2',
 149+ 'globalusage-no-results' => '[[:$1]] не выкарыстоўваецца ў іншых вікі.',
 150+ 'globalusage-on-wiki' => 'Выкарыстаньне ў $2',
 151+ 'globalusage-of-file' => 'Гэты файл выкарыстоўваецца ў наступных вікі:',
 152+ 'globalusage-more' => 'Паказаць [[{{#Special:GlobalUsage}}/$1|поўны сьпіс глябальнага выкарыстаньня]] гэтага файла.',
 153+ 'globalusage-filterlocal' => 'Не паказваць лякальнае выкарыстаньне',
124154 );
125155
126156 /** Bulgarian (Български)
127157 * @author DCLXVI
 158+ * @author Turin
128159 */
129160 $messages['bg'] = array(
130161 'globalusage' => 'Глобално използване на файл',
 162+ 'globalusage-for' => 'Обща употреба на "$1"',
131163 'globalusage-desc' => '[[Special:GlobalUsage|Специална страница]] за преглед на глобалното използване на файл',
132164 'globalusage-ok' => 'Търсене',
133165 'globalusage-text' => 'Търсене за глобалното използване на файл.',
 166+ 'globalusage-no-results' => '[[:$1]] не се използва в други уикита.',
 167+ 'globalusage-on-wiki' => 'Употреба в $2',
 168+ 'globalusage-of-file' => 'Този файл се използва от следните други уикита:',
 169+ 'globalusage-filterlocal' => 'Без показване на локалната употреба',
134170 );
135171
136172 /** Bengali (বাংলা)
@@ -148,7 +184,11 @@
149185 'globalusage-desc' => '[[Special:GlobalUsage|Pajenn dibar]] da welet implij hollek ur skeudenn',
150186 'globalusage-ok' => 'Klask',
151187 'globalusage-text' => 'Klask implij hollek ar restr',
152 - 'globalusage-on-wiki' => 'Implij eus [[:File:$1|$1]] war $2',
 188+ 'globalusage-no-results' => 'Ne reer ket gant [[:$1]] war wikioù all.',
 189+ 'globalusage-on-wiki' => 'Implij war $2',
 190+ 'globalusage-of-file' => 'Ober a ra ar wikioù da-heul gant ar restr-mañ :',
 191+ 'globalusage-more' => 'Gwelet [[{{#Special:GlobalUsage}}/$1|implijoù hollek all]] esu ar restr-mañ.',
 192+ 'globalusage-filterlocal' => "Arabat diskouez an implij lec'hel",
153193 );
154194
155195 /** Bosnian (Bosanski)
@@ -160,18 +200,29 @@
161201 'globalusage-desc' => '[[Special:GlobalUsage|Posebna stranica]] za pregled globalne upotrebe datoteke',
162202 'globalusage-ok' => 'Traži',
163203 'globalusage-text' => 'Pretraga globalne upotrebe datoteke.',
164 - 'globalusage-on-wiki' => 'Upotreba [[:File:$1|$1]] na $2',
 204+ 'globalusage-no-results' => '[[:$1]] nije korištena na drugim wikijima.',
 205+ 'globalusage-on-wiki' => 'Upotreba na $2',
 206+ 'globalusage-of-file' => 'Slijedeći wikiji koriste ovu datoteku:',
 207+ 'globalusage-more' => 'Pogledajte [[{{#Special:GlobalUsage}}/$1|sve globalne upotrebe]] ove datoteke.',
 208+ 'globalusage-filterlocal' => 'Ne prikazuj lokalnu upotrebu',
165209 );
166210
167211 /** Catalan (Català)
168212 * @author Jordi Roqué
169213 * @author SMP
 214+ * @author Vriullop
170215 */
171216 $messages['ca'] = array(
172 - 'globalusage' => 'Ús global de fitxar',
 217+ 'globalusage' => 'Ús global del fitxer',
 218+ 'globalusage-for' => 'Ús global per «$1»',
173219 'globalusage-desc' => "[[Special:GlobalUsage|Pàgina especial]] per a veure l'ús global del fitxer",
174220 'globalusage-ok' => 'Cerca',
175221 'globalusage-text' => "Cerca l'ús global del fitxer.",
 222+ 'globalusage-no-results' => "[[:$1]] no s'utilitza en altres wikis.",
 223+ 'globalusage-on-wiki' => 'Utilització a $2',
 224+ 'globalusage-of-file' => "Utilització d'aquest fitxer en altres wikis:",
 225+ 'globalusage-more' => "Vegeu [[{{#Special:GlobalUsage}}/$1|més usos globals]] d'aquest fitxer.",
 226+ 'globalusage-filterlocal' => "No mostris l'ús local",
176227 );
177228
178229 /** Chamorro (Chamoru)
@@ -181,6 +232,22 @@
182233 'globalusage-ok' => 'Aligao',
183234 );
184235
 236+/** Czech (Česky)
 237+ * @author Mormegil
 238+ */
 239+$messages['cs'] = array(
 240+ 'globalusage' => 'Globální využití souboru',
 241+ 'globalusage-for' => 'Globální využití „$1“',
 242+ 'globalusage-desc' => '[[Special:GlobalUsage|Speciální stránka]] zobrazující globální využití souboru',
 243+ 'globalusage-ok' => 'Hledat',
 244+ 'globalusage-text' => 'Hledání globálního využití souboru',
 245+ 'globalusage-no-results' => '[[:$1]] se na ostatních wiki nepoužívá.',
 246+ 'globalusage-on-wiki' => 'Využití na $2',
 247+ 'globalusage-of-file' => 'Tento soubor využívají následující wiki:',
 248+ 'globalusage-more' => 'Zobrazit [[{{#Special:GlobalUsage}}/$1|další globální využití]] tohoto souboru.',
 249+ 'globalusage-filterlocal' => 'Nezobrazovat místní využití',
 250+);
 251+
185252 /** Church Slavic (Словѣ́ньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ)
186253 * @author ОйЛ
187254 */
@@ -205,12 +272,29 @@
206273 'globalusage-desc' => '[[Special:GlobalUsage|Spezialseite]] zur Anzeige, in welchen Projekten die Dateien eines gemeinsam genutzten Repositoriums verwendet werden',
207274 'globalusage-ok' => 'Suchen',
208275 'globalusage-text' => 'Globale Suche nach Dateinutzungen',
209 - 'globalusage-on-wiki' => 'Nutzung von [[:File:$1|$1]] auf $2',
 276+ 'globalusage-no-results' => '[[:$1]] wird nicht auf anderen Wikis genutzt.',
 277+ 'globalusage-on-wiki' => 'Nutzung auf $2',
210278 'globalusage-of-file' => 'Die nachfolgenden anderen Wikis nutzen diese Datei:',
211279 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Weitere globale Dateinutzung]] für dieser Datei anschauen.',
212280 'globalusage-filterlocal' => 'Zeige keine lokale Dateinutzung',
213281 );
214282
 283+/** Zazaki (Zazaki)
 284+ * @author Xoser
 285+ */
 286+$messages['diq'] = array(
 287+ 'globalusage' => 'Karo dosyayê globali',
 288+ 'globalusage-for' => "Dosyayê globali ser ''$1''",
 289+ 'globalusage-desc' => '[[Special:GlobalUsage|Pelo xas]] ke karo dosyayê globali bivine',
 290+ 'globalusage-ok' => 'Bigêre',
 291+ 'globalusage-text' => 'Karo dosyayê globali bigêre',
 292+ 'globalusage-no-results' => '[[:$1]] wikiyanê binan de çini yo.',
 293+ 'globalusage-on-wiki' => 'Kar ser $2i de',
 294+ 'globalusage-of-file' => 'Wikiyanê ke ena dosya est o:',
 295+ 'globalusage-more' => 'Karo [[{{#Special:GlobalUsage}}/$1|dosyayo global]]ê ena dosya bivine.',
 296+ 'globalusage-filterlocal' => 'Karo local nimocne',
 297+);
 298+
215299 /** Lower Sorbian (Dolnoserbski)
216300 * @author Michawiki
217301 */
@@ -220,7 +304,8 @@
221305 'globalusage-desc' => '[[Special:GlobalUsage|Specialny bok]], aby se globalne wužywanje datajow woglědało',
222306 'globalusage-ok' => 'Pytaś',
223307 'globalusage-text' => 'Za globalnym wužywanim datajow pytaś',
224 - 'globalusage-on-wiki' => 'Wužywanje dataje [[:File:$1|$1]] na $2',
 308+ 'globalusage-no-results' => '[[:$1]] njewužywa se w drugich wikijach.',
 309+ 'globalusage-on-wiki' => 'Wužywanje na $2',
225310 'globalusage-of-file' => 'Slědujuce druge wikije wužywaju toś ten wobraz:',
226311 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Dalšne globalne wužywanje]] toś teje dataje pokazaś',
227312 'globalusage-filterlocal' => 'Lokalne wužywanje njepokazaś',
@@ -229,10 +314,16 @@
230315 /** Greek (Ελληνικά)
231316 * @author Crazymadlover
232317 * @author Omnipaedista
 318+ * @author ZaDiak
 319+ * @author Απεργός
233320 */
234321 $messages['el'] = array(
235 - 'globalusage' => 'Χρήση καθολικού αρχείου',
 322+ 'globalusage' => 'Καθολική χρήση αρχείου',
 323+ 'globalusage-for' => 'Καθολική χρήση για "$1"',
236324 'globalusage-ok' => 'Αναζήτηση',
 325+ 'globalusage-text' => 'Αναζήτηση καθολικής χρήσης αρχείου',
 326+ 'globalusage-no-results' => 'Το αρχείο [[:$1]] δεν χρησιμοποιείται σε άλλα wiki',
 327+ 'globalusage-on-wiki' => 'Χρήση σε $2',
237328 );
238329
239330 /** Esperanto (Esperanto)
@@ -240,29 +331,50 @@
241332 */
242333 $messages['eo'] = array(
243334 'globalusage' => 'Ĝenerala dosier-uzado',
 335+ 'globalusage-for' => 'Ĝenerala uzado por "$1"',
244336 'globalusage-desc' => '[[Special:GlobalUsage|Speciala paĝo]] por rigardi uzadon de ĝeneralaj dosieroj',
245337 'globalusage-ok' => 'Serĉi',
246338 'globalusage-text' => 'Serĉi uzadon de ĝeneralaj dosieroj.',
 339+ 'globalusage-no-results' => '[[:$1]] ne estas uzata en aliaj vikioj.',
 340+ 'globalusage-on-wiki' => 'Uzado en $2',
 341+ 'globalusage-of-file' => 'La jenaj aliaj vikioj utiligas ĉi tiun dosieron:',
 342+ 'globalusage-more' => 'Vidi [[{{#Special:GlobalUsage}}/$1|plian ĝeneralan uzadon]] de ĉi tiu dosiero.',
 343+ 'globalusage-filterlocal' => 'Ne montri lokan uzadon',
247344 );
248345
249346 /** Spanish (Español)
250347 * @author Crazymadlover
251348 * @author Jatrobat
 349+ * @author Translationista
252350 */
253351 $messages['es'] = array(
254352 'globalusage' => 'Uso de archivo global',
 353+ 'globalusage-for' => 'Uso global para "$1"',
255354 'globalusage-desc' => '[[Special:GlobalUsage|Página especial]] para ver uso de archivo global',
256355 'globalusage-ok' => 'Buscar',
257356 'globalusage-text' => 'Buscar uso de archivo global',
 357+ 'globalusage-no-results' => '[[:$1]] no es usado en otros wikis.',
 358+ 'globalusage-on-wiki' => 'Uso en $2',
 359+ 'globalusage-of-file' => 'Los siguientes otros wiki usan este archivo:',
 360+ 'globalusage-more' => 'Ver [[{{#Special:GlobalUsage}}/$1|más uso global]] de este archivo.',
 361+ 'globalusage-filterlocal' => 'Páginas externas',
258362 );
259363
260364 /** Estonian (Eesti)
261365 * @author Avjoska
 366+ * @author Pikne
262367 */
263368 $messages['et'] = array(
264369 'globalusage' => 'Globaalne failikasutus',
 370+ 'globalusage-for' => 'Faili "$1" globaalne kasutus',
 371+ 'globalusage-desc' => '[[Special:GlobalUsage|Erilehekülg]] faili globaalse kasutuse vaatamiseks',
265372 'globalusage-ok' => 'Otsi',
266 - 'globalusage-text' => 'Otsi globaalset failikasutust.',
 373+ 'globalusage-text' => 'Faili globaalse kasutuse otsimine',
 374+ 'globalusage-no-results' => '[[:$1]] pole muudes vikides kasutusel.',
 375+ 'globalusage-on-wiki' => 'Faili kasutus vikis $2',
 376+ 'globalusage-of-file' => 'Järgmised muud vikid kasutavad seda faili:',
 377+ 'globalusage-more' => 'Vaata veel selle faili [[{{#Special:GlobalUsage}}/$1|globaalset kasutust]].',
 378+ 'globalusage-filterlocal' => 'Ära näita kohalikku kasutust',
267379 );
268380
269381 /** Basque (Euskara)
@@ -276,16 +388,27 @@
277389 );
278390
279391 /** Finnish (Suomi)
 392+ * @author Crt
280393 * @author ZeiP
281394 */
282395 $messages['fi'] = array(
 396+ 'globalusage' => 'Tiedoston käyttö globaalisti',
 397+ 'globalusage-for' => 'Globaali käyttö tiedostolle ”$1”',
 398+ 'globalusage-desc' => '[[Special:GlobalUsage|Toimintosivu]] globaalin tiedostokäytön näyttämiseen',
283399 'globalusage-ok' => 'Hae',
 400+ 'globalusage-text' => 'Globaali haku tiedoston käytöstä',
 401+ 'globalusage-no-results' => '[[:$1]] ei ole käytössä muissa wikeissä.',
 402+ 'globalusage-on-wiki' => 'Käyttö kohteessa $2',
 403+ 'globalusage-of-file' => 'Seuraavat muut wikit käyttävät tätä tiedostoa:',
 404+ 'globalusage-more' => 'Näytä [[{{#Special:GlobalUsage}}/$1|lisää tiedoston globaalia käyttöä.]]',
 405+ 'globalusage-filterlocal' => 'Älä näytä paikallista käyttöä',
284406 );
285407
286408 /** French (Français)
287409 * @author Grondin
288410 * @author IAlex
289411 * @author Meithal
 412+ * @author Peter17
290413 * @author PieRRoMaN
291414 * @author Verdy p
292415 */
@@ -295,12 +418,29 @@
296419 'globalusage-desc' => '[[Special:GlobalUsage|Page spéciale]] pour voir l’usage global d’une image',
297420 'globalusage-ok' => 'Rechercher',
298421 'globalusage-text' => "Rechercher l'usage global du fichier",
299 - 'globalusage-on-wiki' => 'Utilisation de [[:File:$1|$1]] sur $2',
 422+ 'globalusage-no-results' => "[[:$1]] n'est pas utilisé sur d'autres wikis.",
 423+ 'globalusage-on-wiki' => 'Utilisation sur $2',
300424 'globalusage-of-file' => 'Les autres wikis suivants utilisent cette image :',
301425 'globalusage-more' => "Voir [[{{#Special:GlobalUsage}}/$1|d'autres utilisations globales]] de ce fichier.",
302426 'globalusage-filterlocal' => "Ne pas montrer l'utilisation locale",
303427 );
304428
 429+/** Franco-Provençal (Arpetan)
 430+ * @author ChrisPtDe
 431+ */
 432+$messages['frp'] = array(
 433+ 'globalusage' => 'Usâjo globâl du fichiér',
 434+ 'globalusage-for' => 'Usâjo globâl por « $1 »',
 435+ 'globalusage-desc' => '[[Special:GlobalUsage|Pâge spèciâla]] por vêre l’usâjo globâl d’un fichiér.',
 436+ 'globalusage-ok' => 'Rechèrchiér',
 437+ 'globalusage-text' => 'Rechèrchiér l’usâjo globâl du fichiér',
 438+ 'globalusage-no-results' => '[[:$1]] est pas utilisâ sur d’ôtros vouiquis.',
 439+ 'globalusage-on-wiki' => 'Usâjo dessus $2',
 440+ 'globalusage-of-file' => 'Cetos ôtros vouiquis utilisont ceti fichiér :',
 441+ 'globalusage-more' => 'Vêre d’[[{{#Special:GlobalUsage}}/$1|ôtros usâjos globâls]] de ceti fichiér.',
 442+ 'globalusage-filterlocal' => 'Pas montrar l’usâjo local',
 443+);
 444+
305445 /** Western Frisian (Frysk)
306446 * @author Snakesteuben
307447 */
@@ -318,7 +458,8 @@
319459 'globalusage-desc' => '[[Special:GlobalUsage|Páxina especial]] para ver o uso global do ficheiro',
320460 'globalusage-ok' => 'Procurar',
321461 'globalusage-text' => 'Procurar o uso global do ficheiro.',
322 - 'globalusage-on-wiki' => 'Uso de "[[:File:$1|$1]]" en $2',
 462+ 'globalusage-no-results' => '[[:$1]] non se emprega noutros wikis.',
 463+ 'globalusage-on-wiki' => 'Uso en $2',
323464 'globalusage-of-file' => 'Os seguintes wikis empregan esta imaxe:',
324465 'globalusage-more' => 'Ver [[{{#Special:GlobalUsage}}/$1|máis usos globais]] deste ficheiro.',
325466 'globalusage-filterlocal' => 'Non mostrar o uso local',
@@ -340,7 +481,11 @@
341482 'globalusage-desc' => '[[Special:GlobalUsage|Spezialsyte]] zu Aazeige, in welene Projäkt d Dateien vun eme gmeinsam gnutzte Repositoriums verwändet wäre',
342483 'globalusage-ok' => 'Sueche',
343484 'globalusage-text' => 'Wältwyt no Dateinutzige sueche',
344 - 'globalusage-on-wiki' => 'Gebruch vu [[:File:$1|$1]] uf $2',
 485+ 'globalusage-no-results' => '[[:$1]] wird nit in andere Wiki brucht.',
 486+ 'globalusage-on-wiki' => 'Gebruch uf $2',
 487+ 'globalusage-of-file' => 'Die andere Wikis bruche die Datei:',
 488+ 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Wygteri wältwyti Verwändig]] vu däre Datei aaluege.',
 489+ 'globalusage-filterlocal' => 'Kei lokali Dateiverwändig zeige',
345490 );
346491
347492 /** Gujarati (ગુજરાતી)
@@ -381,7 +526,10 @@
382527 'globalusage-desc' => '[[Special:GlobalUsage|דף מיוחד]] להצגת השימוש הגלובלי בקבצים',
383528 'globalusage-ok' => 'חיפוש',
384529 'globalusage-text' => 'חיפוש בשימוש הגלובלי בקבצים.',
 530+ 'globalusage-no-results' => '[[:$1]] אינו בשימוש באתרי ויקי אחרים.',
385531 'globalusage-on-wiki' => '[[:File:$1|$1]] בשימוש באתר $2',
 532+ 'globalusage-of-file' => 'אתרי הוויקי השונים הבאים משתמשים בקובץ זה:',
 533+ 'globalusage-filterlocal' => 'אין להציג שימוש מקומי',
386534 );
387535
388536 /** Hindi (हिन्दी)
@@ -410,7 +558,8 @@
411559 'globalusage-desc' => '[[Special:GlobalUsage|Specialna strona]], zo by globalne wužiwanje wobraza widźał',
412560 'globalusage-ok' => 'Podać',
413561 'globalusage-text' => 'Globalne wužiwanje dataje pytać.',
414 - 'globalusage-on-wiki' => 'Wužiwanje dataje [[:File:$1|$1]] na $2',
 562+ 'globalusage-no-results' => '[[:$1]] njewužiwa so w druhich wikijach.',
 563+ 'globalusage-on-wiki' => 'Wužiwanje na $2',
415564 'globalusage-of-file' => 'Slědowace druhe wikije wužiwaja tutón wobraz:',
416565 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Dalše globalne wužiwanje]] tuteje dataje pokazać',
417566 'globalusage-filterlocal' => 'Lokalne wužiwanje njepokazać',
@@ -421,12 +570,16 @@
422571 * @author Glanthor Reviol
423572 */
424573 $messages['hu'] = array(
425 - 'globalusage' => 'Globális fájl-használat megjelenítése',
 574+ 'globalusage' => 'Globális fájlhasználat',
426575 'globalusage-for' => '„$1” globális használata',
427576 'globalusage-desc' => '[[Special:GlobalUsage|Speciális lap]] globális fájlhasználat megjelenítésére',
428577 'globalusage-ok' => 'Keresés',
429578 'globalusage-text' => 'Fájlhasználat globális keresése',
430 - 'globalusage-on-wiki' => '[[:File:$1|$1]] használata itt: $2',
 579+ 'globalusage-no-results' => 'A(z) [[:$1]] fájl nincs más wikiken használva.',
 580+ 'globalusage-on-wiki' => 'Használata itt: $2',
 581+ 'globalusage-of-file' => 'A következő wikik használják ezt a fájlt:',
 582+ 'globalusage-more' => 'A fájl [[{{#Special:GlobalUsage}}/$1|globális használatának]] megtekintése',
 583+ 'globalusage-filterlocal' => 'Ne mutassa a helyi használatot',
431584 );
432585
433586 /** Armenian (Հայերեն)
@@ -445,7 +598,8 @@
446599 'globalusage-desc' => '[[Special:GlobalUsage|Pagina special]] pro vider le uso global de files',
447600 'globalusage-ok' => 'Cercar',
448601 'globalusage-text' => 'Cercar uso global de files.',
449 - 'globalusage-on-wiki' => 'Uso de [[:File:$1|$1]] in $2',
 602+ 'globalusage-no-results' => '[[:$1]] non es usate in altere wikis.',
 603+ 'globalusage-on-wiki' => 'Uso in $2',
450604 'globalusage-of-file' => 'Le altere wikis sequente usa iste imagine:',
451605 'globalusage-more' => 'Vider [[{{#Special:GlobalUsage}}/$1|ulterior uso global]] de iste file.',
452606 'globalusage-filterlocal' => 'Non monstrar uso local',
@@ -462,7 +616,8 @@
463617 'globalusage-desc' => '[[Special:GlobalUsage|Halaman istimewa]] untuk melihat penggunaan berkas secara global',
464618 'globalusage-ok' => 'Cari',
465619 'globalusage-text' => 'Cari penggunaan berkas secara global.',
466 - 'globalusage-on-wiki' => 'Penggunaan [[:File:$1|$1]] pada $2',
 620+ 'globalusage-no-results' => '[[:$1]] tidak digunakan di wiki lain.',
 621+ 'globalusage-on-wiki' => 'Penggunaan pada $2',
467622 'globalusage-of-file' => 'Wiki lain berikut menggunakan berkas ini:',
468623 'globalusage-more' => 'Lihat [[{{#Special:GlobalUsage}}/$1|penggunaan global lain]] dari berkas ini.',
469624 'globalusage-filterlocal' => 'Jangan tunjukkan penggunaan lokal',
@@ -494,7 +649,8 @@
495650 'globalusage-desc' => 'グローバルなファイル使用状況を見るための[[Special:GlobalUsage|特別ページ]]',
496651 'globalusage-ok' => '検索',
497652 'globalusage-text' => 'グローバルなファイル使用状況を検索する',
498 - 'globalusage-on-wiki' => '$2での[[:File:$1|$1]]の利用状況',
 653+ 'globalusage-no-results' => '[[:$1]] は他のウィキでは使われていません。',
 654+ 'globalusage-on-wiki' => '$2 での使用状況',
499655 'globalusage-of-file' => '以下に挙げる他のウィキがこの画像を使っています:',
500656 'globalusage-more' => 'このファイルの[[{{#Special:GlobalUsage}}/$1|グローバル使用状況]]をさらに表示する。',
501657 'globalusage-filterlocal' => 'ローカル使用状況を表示しない',
@@ -510,6 +666,14 @@
511667 'globalusage-text' => 'Golèk panggunan global berkas.',
512668 );
513669
 670+/** Georgian (ქართული)
 671+ * @author BRUTE
 672+ */
 673+$messages['ka'] = array(
 674+ 'globalusage' => 'ფაილის გლობალური გამოყენება',
 675+ 'globalusage-ok' => 'ძიება',
 676+);
 677+
514678 /** Khmer (ភាសាខ្មែរ)
515679 * @author Chhorran
516680 * @author Lovekhmer
@@ -522,6 +686,22 @@
523687 'globalusage-text' => 'ស្វែងរកបម្រើបម្រាស់ឯកសារជាសាកល។',
524688 );
525689
 690+/** Korean (한국어)
 691+ * @author Kwj2772
 692+ */
 693+$messages['ko'] = array(
 694+ 'globalusage' => '특정 파일을 사용하고 있는 모든 위키의 문서 목록',
 695+ 'globalusage-for' => '"$1" 파일을 사용하고 있는 모든 위키의 문서 목록',
 696+ 'globalusage-desc' => '특정 파일을 사용하고 있는 모든 위키의 문서의 목록을 보여주는 [[Special:GlobalUsage|특수 문서]]를 추가',
 697+ 'globalusage-ok' => '찾기',
 698+ 'globalusage-text' => '특정 파일이 사용되고 있는 모든 위키의 문서 찾기',
 699+ 'globalusage-no-results' => '[[:$1]]은 다른 위키에서 사용되지 않고 있습니다.',
 700+ 'globalusage-on-wiki' => '$2에서 이 파일을 사용하고 있는 문서 목록',
 701+ 'globalusage-of-file' => '다음 위키에서 이 파일을 사용하고 있습니다:',
 702+ 'globalusage-more' => '이 파일을 사용하고 있는 [[{{#Special:GlobalUsage}}/$1|다른 위키의 더 많은 문서]]를 보기',
 703+ 'globalusage-filterlocal' => '이 위키에서 이 파일을 사용하고 있는 문서를 보이지 않기',
 704+);
 705+
526706 /** Krio (Krio)
527707 * @author Jose77
528708 */
@@ -545,10 +725,14 @@
546726 'globalusage-desc' => '[[Special:GlobalUsage|Söndersigg]] för jemeinsam jebruch Dateie ze zeije.',
547727 'globalusage-ok' => 'Söhk!',
548728 'globalusage-text' => 'Söhk noh jemeinsam jebruch Datteie.',
549 - 'globalusage-on-wiki' => 'Dä Jebruch vun dä Dattei „[[:File:$1|$1]]“ op $2',
 729+ 'globalusage-no-results' => '[[:$1]] weed in ander Wikis nit jebruch.',
 730+ 'globalusage-on-wiki' => 'Dä Jebruch op $2',
 731+ 'globalusage-of-file' => 'Heh di ander Wikis bruche di Dattei:',
 732+ 'globalusage-more' => 'Loor noh [[{{#Special:GlobalUsage}}/$1|mieh övver dä Jebruch]] vun heh dä Dattei.',
 733+ 'globalusage-filterlocal' => 'Donn nix aanzeije doh drövver, wi di Dattei heh em Wiki jebruch weed',
550734 );
551735
552 -/** Kurdish (Latin) (Kurdî / كوردی (Latin))
 736+/** Kurdish (Latin) (Kurdî (Latin))
553737 * @author Bangin
554738 */
555739 $messages['ku-latn'] = array(
@@ -565,7 +749,11 @@
566750 'globalusage-desc' => "[[Special:GlobalUsage|Spezialsäit]] fir d'globaalt Benotze vun engem Fichier ze gesinn",
567751 'globalusage-ok' => 'Sichen',
568752 'globalusage-text' => 'Nom globale Benotze vum Fichier sichen.',
569 - 'globalusage-on-wiki' => 'Notzung vu(n) [[:File:$1|$1]] op $2',
 753+ 'globalusage-no-results' => '[[:$1]] gëtt net op anere Wikie benotzt.',
 754+ 'globalusage-on-wiki' => 'Notzen op $2',
 755+ 'globalusage-of-file' => 'Dës aner Wikien benotzen dëse Fichier:',
 756+ 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Méi global Notzunge]] vun dësem Fichier weisen.',
 757+ 'globalusage-filterlocal' => 'Déi lokal Notzung net weisen',
570758 );
571759
572760 /** Lingua Franca Nova (Lingua Franca Nova)
@@ -600,17 +788,28 @@
601789 'globalusage-desc' => '[[Special:GlobalUsage|Специјална страница]] за преглед на употребата на глобални податотеки',
602790 'globalusage-ok' => 'Пребарај',
603791 'globalusage-text' => 'Пребарување на глобална употреба на податотеки.',
604 - 'globalusage-on-wiki' => 'Користење на [[:File:$1|$1]] на $2',
 792+ 'globalusage-no-results' => '[[:$1]] не се користи во други викија..',
 793+ 'globalusage-on-wiki' => 'Искористеност на $2',
 794+ 'globalusage-of-file' => 'Оваа податотека ја користат и следниве викија:',
 795+ 'globalusage-more' => 'Преглед на [[{{#Special:GlobalUsage}}/$1|уште глобално користење]] на оваа податотека.',
 796+ 'globalusage-filterlocal' => 'Не прикажувај локално користење',
605797 );
606798
607799 /** Malayalam (മലയാളം)
 800+ * @author Praveenp
608801 * @author Shijualex
609802 */
610803 $messages['ml'] = array(
611804 'globalusage' => 'പ്രമാണത്തിന്റെ ആഗോള ഉപയോഗം',
 805+ 'globalusage-for' => '"$1" ആഗോള ഉപയോഗം',
612806 'globalusage-desc' => 'പ്രമാണത്തിന്റെ ആഗോള ഉപയോഗം കാണിക്കുവാനുള്ള [[Special:GlobalUsage|പ്രത്യേക താള്‍]]',
613807 'globalusage-ok' => 'തിരയൂ',
614808 'globalusage-text' => 'പ്രമാണത്തിന്റെ ആഗോള ഉപയോഗം തിരയുക',
 809+ 'globalusage-no-results' => '[[:$1]] മറ്റു വിക്കികളിൽ ഉപയോഗിക്കുന്നില്ല.',
 810+ 'globalusage-on-wiki' => '$2 സംരംഭത്തിലെ ഉപയോഗം',
 811+ 'globalusage-of-file' => 'താഴെ കൊടുക്കുന്ന വിക്കികളും ഈ പ്രമാണം ഉപയോഗിക്കുന്നു:',
 812+ 'globalusage-more' => 'ഈ പ്രമാണത്തിന്റെ [[{{#Special:GlobalUsage}}/$1|കൂടുതൽ ആഗോള ഉപയോഗം]] കാണുക.',
 813+ 'globalusage-filterlocal' => 'പ്രാദേശിക ഉപയോഗം പ്രദർശിപ്പിക്കരുത്',
615814 );
616815
617816 /** Mongolian (Монгол)
@@ -654,7 +853,11 @@
655854 'globalusage-desc' => '[[Special:GlobalUsage|Speciale pagina]] voor het bekijken van globaal bestandsgebruik',
656855 'globalusage-ok' => 'Zoeken',
657856 'globalusage-text' => 'Globaal bestandsgebruik bekijken',
658 - 'globalusage-on-wiki' => 'Gebruik van [[:File:$1|$1]] in $2',
 857+ 'globalusage-no-results' => "[[:$1]] wordt niet gebruikt in andere wiki's.",
 858+ 'globalusage-on-wiki' => 'Gebruik in $2',
 859+ 'globalusage-of-file' => "De volgende andere wiki's gebruiken dit bestand:",
 860+ 'globalusage-more' => '[[{{#Special:GlobalUsage}}/$1|Meer globaal gebruik]] van dit bestand bekijken.',
 861+ 'globalusage-filterlocal' => 'Lokaal gebruik niet weergeven',
659862 );
660863
661864 /** Norwegian Nynorsk (‪Norsk (nynorsk)‬)
@@ -670,12 +873,19 @@
671874
672875 /** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
673876 * @author Jon Harald Søby
 877+ * @author Nghtwlkr
674878 */
675879 $messages['no'] = array(
676880 'globalusage' => 'Global filbruk',
 881+ 'globalusage-for' => 'Global bruk av "$1"',
677882 'globalusage-desc' => '[[Special:GlobalUsage|Spesialside]] for å vise bruken av en fil globalt',
678883 'globalusage-ok' => 'Søk',
679884 'globalusage-text' => 'Søk global filbruk.',
 885+ 'globalusage-no-results' => '[[:$1]] er ikke brukt på andre wikier.',
 886+ 'globalusage-on-wiki' => 'Bruk i $2',
 887+ 'globalusage-of-file' => 'Følgende andre wikier bruker denne filen:',
 888+ 'globalusage-more' => 'Vis [[{{#Special:GlobalUsage}}/$1|mer global bruk]] av denne filen',
 889+ 'globalusage-filterlocal' => 'Ikke vis lokal bruk',
680890 );
681891
682892 /** Occitan (Occitan)
@@ -687,7 +897,11 @@
688898 'globalusage-desc' => '[[Special:GlobalUsage|Pagina especiala]] per veire l’usatge global d’un imatge',
689899 'globalusage-ok' => 'Recèrca',
690900 'globalusage-text' => "Recercar l'usatge global del fichièr",
691 - 'globalusage-on-wiki' => 'Utilizacion de [[:File:$1|$1]] sus $2',
 901+ 'globalusage-no-results' => "[[:$1]] es pas utilizat sus d'autres wikis.",
 902+ 'globalusage-on-wiki' => 'Utilizacion sus $2',
 903+ 'globalusage-of-file' => 'Los autres wikis seguents utilizan aqueste imatge :',
 904+ 'globalusage-more' => "Veire [[{{#Special:GlobalUsage}}/$1|d'autras utilizacions globalas]] d'aqueste fichièr.",
 905+ 'globalusage-filterlocal' => "Far pas veire l'utilizacion locala",
692906 );
693907
694908 /** Oriya (ଓଡ଼ିଆ)
@@ -704,21 +918,33 @@
705919 'globalusage-ok' => 'Агур',
706920 );
707921
 922+/** Deitsch (Deitsch)
 923+ * @author Xqt
 924+ */
 925+$messages['pdc'] = array(
 926+ 'globalusage-ok' => 'Uffgucke',
 927+);
 928+
708929 /** Polish (Polski)
709930 * @author Leinad
710931 * @author Maikking
711932 * @author Sp5uhe
712933 */
713934 $messages['pl'] = array(
714 - 'globalusage' => 'Globalne użycie pliku',
715 - 'globalusage-for' => 'Globalne użycie „$1”',
716 - 'globalusage-desc' => '[[Special:GlobalUsage|Strona specjalna]] raportująca globalnie wykorzystanie pliku',
 935+ 'globalusage' => 'Globalne wykorzystanie pliku',
 936+ 'globalusage-for' => 'Globalne wykorzystanie „$1”',
 937+ 'globalusage-desc' => '[[Special:GlobalUsage|Strona specjalna]] pokazująca globalne wykorzystanie pliku',
717938 'globalusage-ok' => 'Szukaj',
718939 'globalusage-text' => 'Globalne wyszukiwanie wykorzystania pliku',
719 - 'globalusage-on-wiki' => 'Wykorzystanie [[:File:$1|$1]] w {{GRAMMAR:MS.lp:$2}}',
 940+ 'globalusage-no-results' => '[[:$1]] nie jest wykorzystywany w inny projektach wiki.',
 941+ 'globalusage-on-wiki' => 'Wykorzystanie w $2',
 942+ 'globalusage-of-file' => 'Ten plik jest wykorzystywany także w innych projektach wiki:',
 943+ 'globalusage-more' => 'Pokaż [[{{#Special:GlobalUsage}}/$1|pełną listę globalnego wykorzystania]] tego pliku.',
 944+ 'globalusage-filterlocal' => 'Nie pokazuj lokalnego wykorzystania',
720945 );
721946
722947 /** Piedmontese (Piemontèis)
 948+ * @author Borichèt
723949 * @author Dragonòt
724950 */
725951 $messages['pms'] = array(
@@ -727,7 +953,11 @@
728954 'globalusage-desc' => '[[Special:GlobalUsage|Pàgina special]] për vëdde ël dovragi global dël file',
729955 'globalusage-ok' => 'Serca',
730956 'globalusage-text' => 'Serca ël dovragi global dël file.',
731 - 'globalusage-on-wiki' => 'Usagi ëd [[:File:$1|$1]] dzora $2',
 957+ 'globalusage-no-results' => "[[:$1]] a l'é pa dovrà dzora d'àutre wiki.",
 958+ 'globalusage-on-wiki' => 'Usagi dzora $2',
 959+ 'globalusage-of-file' => "J'àutre wiki sì sota a deuvro st'archivi-sì:",
 960+ 'globalusage-more' => "Varda l'[[{{#Special:GlobalUsage}}/$1|usagi global]] dë st'archivi-sì.",
 961+ 'globalusage-filterlocal' => "Mosta nen l'usagi local.",
732962 );
733963
734964 /** Pashto (پښتو)
@@ -735,20 +965,33 @@
736966 */
737967 $messages['ps'] = array(
738968 'globalusage' => 'د نړېوالې دوتنې کارېدنګ',
 969+ 'globalusage-for' => 'د "$1" لپاره نړېوالې کارېدنې',
739970 'globalusage-desc' => 'د نړېوالې دوتنې د کارېدنګ د مخليدنې لپاره [[Special:GlobalUsage|ځانګړی مخ]]',
740971 'globalusage-ok' => 'پلټل',
741972 'globalusage-text' => 'د نړېوالې دوتنې کارېدنګ پلټل',
 973+ 'globalusage-no-results' => '[[:$1]] په نورو ويکي ګانو نه کارېږي.',
 974+ 'globalusage-on-wiki' => 'په $2 کارونې',
 975+ 'globalusage-of-file' => 'همدا دوتنه لاندينۍ نورې ويکي ګانې کاروي:',
 976+ 'globalusage-more' => 'د همدې دوتنې [[{{#Special:GlobalUsage}}/$1|نورې نړېوالې کارونې]] کتل.',
 977+ 'globalusage-filterlocal' => 'سيمه ايزې کارونې مه ښکاره کوه',
742978 );
743979
744980 /** Portuguese (Português)
 981+ * @author Hamilton Abreu
745982 * @author Lijealso
746983 * @author Malafaya
747984 */
748985 $messages['pt'] = array(
749 - 'globalusage' => 'Utilização global de ficheiro',
 986+ 'globalusage' => 'Utilização global de ficheiros',
 987+ 'globalusage-for' => 'Utilização global de "$1"',
750988 'globalusage-desc' => '[[Special:GlobalUsage|Página especial]] para consultar a utilização global de ficheiros',
751 - 'globalusage-ok' => 'Busca',
752 - 'globalusage-text' => 'Pesquisar utilização global de ficheiro.',
 989+ 'globalusage-ok' => 'Pesquisar',
 990+ 'globalusage-text' => 'Pesquisar utilização global de ficheiros.',
 991+ 'globalusage-no-results' => '[[:$1]] não é usado noutras wikis.',
 992+ 'globalusage-on-wiki' => 'Uso de [[:File:$1|$1]] na $2',
 993+ 'globalusage-of-file' => 'As seguintes wikis usam este ficheiro:',
 994+ 'globalusage-more' => 'Ver [[{{#Special:GlobalUsage}}/$1|mais utilizações globais]] deste ficheiro.',
 995+ 'globalusage-filterlocal' => 'Não mostrar utilizações locais',
753996 );
754997
755998 /** Brazilian Portuguese (Português do Brasil)
@@ -770,16 +1013,35 @@
7711014
7721015 /** Romanian (Română)
7731016 * @author KlaudiuMihaila
 1017+ * @author Minisarm
7741018 */
7751019 $messages['ro'] = array(
 1020+ 'globalusage' => 'Utilizarea globală a fişierului',
 1021+ 'globalusage-for' => 'Utilizarea globală a fişierului „$1”',
 1022+ 'globalusage-desc' => '[[Special:GlobalUsage|Pagină specială]] pentru vizualizarea utilizării globale a fişierului',
7761023 'globalusage-ok' => 'Caută',
 1024+ 'globalusage-text' => 'Caută utilizările globale ale fişierului',
 1025+ 'globalusage-no-results' => 'Fişierul „[[:$1]]” nu este folosit la alte proiecte de tip wiki.',
 1026+ 'globalusage-on-wiki' => 'Utilizarea fişierului „[[:File:$1|$1]]” la $2',
 1027+ 'globalusage-of-file' => 'Următoarele alte proiecte de tip wiki folosesc acest fişier:',
 1028+ 'globalusage-more' => 'Vizualizaţi [[{{#Special:GlobalUsage}}/$1|mai multe utilizări globale]] ale acestui fişier.',
 1029+ 'globalusage-filterlocal' => 'Nu afişa utilizările locale.',
7771030 );
7781031
7791032 /** Tarandíne (Tarandíne)
7801033 * @author Joetaras
7811034 */
7821035 $messages['roa-tara'] = array(
 1036+ 'globalusage' => "Ause d'u file globale",
 1037+ 'globalusage-for' => 'Ause globale pe "$1"',
 1038+ 'globalusage-desc' => "[[Special:GlobalUsage|Pàgena speciale]] pe vedè l'ause de le file globale",
7831039 'globalusage-ok' => 'Cirche',
 1040+ 'globalusage-text' => 'Cirche le file de ause globale',
 1041+ 'globalusage-no-results' => "[[:$1]] non g'è ausate jndr'à otre Uicchi.",
 1042+ 'globalusage-on-wiki' => 'Ause sus a $2',
 1043+ 'globalusage-of-file' => 'Le seguende Uicchi ausane stu file:',
 1044+ 'globalusage-more' => 'Vide [[{{#Special:GlobalUsage}}/$1|otre ause globale]] de stu file.',
 1045+ 'globalusage-filterlocal' => "No fà vedè l'ause locale",
7841046 );
7851047
7861048 /** Russian (Русский)
@@ -791,9 +1053,20 @@
7921054 'globalusage-desc' => '[[Special:GlobalUsage|Служебная страница]] для просмотра общего использования файла',
7931055 'globalusage-ok' => 'Найти',
7941056 'globalusage-text' => 'Поиск глобального использования файла.',
 1057+ 'globalusage-no-results' => '[[:$1]] не используется в других вики.',
7951058 'globalusage-on-wiki' => 'Использование [[:File:$1|$1]] в $2',
 1059+ 'globalusage-of-file' => 'Данный файл используется в следующих вики:',
 1060+ 'globalusage-more' => 'Просмотреть [[{{#Special:GlobalUsage}}/$1|подробнее глобальное использование]] этого файла.',
 1061+ 'globalusage-filterlocal' => 'Не показывать локальное использование',
7961062 );
7971063
 1064+/** Yakut (Саха тыла)
 1065+ * @author HalanTul
 1066+ */
 1067+$messages['sah'] = array(
 1068+ 'globalusage-ok' => 'Буларга',
 1069+);
 1070+
7981071 /** Slovak (Slovenčina)
7991072 * @author Helix84
8001073 */
@@ -803,17 +1076,22 @@
8041077 'globalusage-desc' => '[[Special:GlobalUsage|Špeciálna stránka]] na zobrazenie celkového využitia súborov',
8051078 'globalusage-ok' => 'Hľadať',
8061079 'globalusage-text' => 'Hľadať globálne využitie súborov.',
 1080+ 'globalusage-no-results' => '[[:$1]] sa nepoužíva na iných wiki.',
8071081 'globalusage-on-wiki' => 'Použitie [[:File:$1|$1]] na $2',
 1082+ 'globalusage-of-file' => 'Nasledovné ďalšie wiki používajú tento súbor:',
 1083+ 'globalusage-more' => 'Zobraziť [[{{#Special:GlobalUsage}}/$1|ďalšie globálne použitie]] tohto súboru.',
 1084+ 'globalusage-filterlocal' => 'Nezobrazovať lokálne použitie',
8081085 );
8091086
8101087 /** Lower Silesian (Schläsch)
8111088 * @author Jonny84
 1089+ * @author Schläsinger
8121090 */
8131091 $messages['sli'] = array(
8141092 'globalusage' => 'Globale Dateinutzung',
815 - 'globalusage-desc' => '[[Special:GlobalUsage|Spezialseite]] zur Anzeige, ei welchen Projekten de Dateien eines gemeinsam genutzten Repositoriums verwendet werde',
816 - 'globalusage-ok' => 'Suchen',
817 - 'globalusage-text' => 'Globale Suche nach Dateinutzungen.',
 1093+ 'globalusage-desc' => '[[Special:GlobalUsage|Spezialseyte]] zur Oazeige, ei welchen Projekten de Dateien annes gemeinsam genutzten Repositoriums verwendet waan',
 1094+ 'globalusage-ok' => 'Sicha',
 1095+ 'globalusage-text' => 'Globale Siche noach Dateinutzungen.',
8181096 );
8191097
8201098 /** Serbian Cyrillic ekavian (Српски (ћирилица))
@@ -855,14 +1133,21 @@
8561134 );
8571135
8581136 /** Swedish (Svenska)
 1137+ * @author Boivie
8591138 * @author Lejonel
8601139 * @author M.M.S.
8611140 */
8621141 $messages['sv'] = array(
8631142 'globalusage' => 'Global filanvändning',
 1143+ 'globalusage-for' => 'Globalt användande av "$1"',
8641144 'globalusage-desc' => '[[Special:GlobalUsage|Specialsida]] för att visa på vilka projekt filer från den gemensamma filservern används.',
8651145 'globalusage-ok' => 'Sök',
8661146 'globalusage-text' => 'Sök global filanvändning.',
 1147+ 'globalusage-no-results' => '[[:$1]] används inte på andra wikier.',
 1148+ 'globalusage-on-wiki' => 'Användande av [[:File:$1|$1]] på $2',
 1149+ 'globalusage-of-file' => 'Följande andra wikier använder denna fil:',
 1150+ 'globalusage-more' => 'Visa [[{{#Special:GlobalUsage}}/$1|mer globalt användande]] av denna fil.',
 1151+ 'globalusage-filterlocal' => 'Visa inte lokalt användande',
8671152 );
8681153
8691154 /** Silesian (Ślůnski)
@@ -884,9 +1169,15 @@
8851170 */
8861171 $messages['te'] = array(
8871172 'globalusage' => 'సార్వత్రిక ఫైలు వాడుక',
 1173+ 'globalusage-for' => '"$1" యొక్క సార్వత్రిక వాడుక',
8881174 'globalusage-desc' => 'సార్వత్రిక ఫైలు వాడుకని చూడడానికి [[Special:GlobalUsage|ప్రత్యేక పేజీ]]',
8891175 'globalusage-ok' => 'వెతుకు',
8901176 'globalusage-text' => 'సార్వత్రిక ఫైళ్ళ వాడుకలో వెతకండి.',
 1177+ 'globalusage-no-results' => '[[:$1]]ని ఇతర వికీలలో ఉపయోగించట్లేదు.',
 1178+ 'globalusage-on-wiki' => '$2 లో వాడుక',
 1179+ 'globalusage-of-file' => 'ఈ ఫైలుని క్రింది ఇతర వికీలు ఉపయోగిస్తున్నాయి:',
 1180+ 'globalusage-more' => 'ఈ ఫైలు యొక్క [[{{#Special:GlobalUsage}}/$1|మరింత సార్వత్రిక వాడుకని]] చూడండి.',
 1181+ 'globalusage-filterlocal' => 'స్థానిక వాడుకని చూపించకు',
8911182 );
8921183
8931184 /** Tetum (Tetun)
@@ -906,6 +1197,16 @@
9071198 'globalusage-text' => 'Ҷустуҷӯи истифодаи саросарии парванда.',
9081199 );
9091200
 1201+/** Tajik (Latin) (Тоҷикӣ (Latin))
 1202+ * @author Liangent
 1203+ */
 1204+$messages['tg-latn'] = array(
 1205+ 'globalusage' => 'Istifodai sarosariji parvanda',
 1206+ 'globalusage-desc' => '[[Special:GlobalUsage|Sahifai viƶa]] baroi didani istifodai sarosariji parvanda',
 1207+ 'globalusage-ok' => 'Çustuçū',
 1208+ 'globalusage-text' => 'Çustuçūi istifodai sarosariji parvanda.',
 1209+);
 1210+
9101211 /** Thai (ไทย)
9111212 * @author Octahedron80
9121213 */
@@ -913,6 +1214,22 @@
9141215 'globalusage-ok' => 'สืบค้น',
9151216 );
9161217
 1218+/** Turkmen (Türkmençe)
 1219+ * @author Hanberke
 1220+ */
 1221+$messages['tk'] = array(
 1222+ 'globalusage' => 'Global faýl ulanyşy',
 1223+ 'globalusage-for' => '"$1" üçin global ulanyş',
 1224+ 'globalusage-desc' => 'Global faýl ulanyşyny görmek üçin [[Special:GlobalUsage|ýörite sahypa]]',
 1225+ 'globalusage-ok' => 'Gözle',
 1226+ 'globalusage-text' => 'Global faýl ulanyşyny gözle',
 1227+ 'globalusage-no-results' => '[[:$1]] başga wikilerde ulanylmaýar.',
 1228+ 'globalusage-on-wiki' => '$2 sahypasynda ulanyş',
 1229+ 'globalusage-of-file' => 'Bu faýl aşakdaky beýleki wikiler tarapyndan ulanylýar:',
 1230+ 'globalusage-more' => 'Bu faýlyň [[{{#Special:GlobalUsage}}/$1|global ulanyşyny]] görkez.',
 1231+ 'globalusage-filterlocal' => 'Ýerli ulanyşy görkezme',
 1232+);
 1233+
9171234 /** Tagalog (Tagalog)
9181235 * @author AnakngAraw
9191236 */
@@ -925,20 +1242,51 @@
9261243
9271244 /** Turkish (Türkçe)
9281245 * @author Joseph
 1246+ * @author Vito Genovese
9291247 */
9301248 $messages['tr'] = array(
9311249 'globalusage' => 'Küresel dosya kullanımı',
 1250+ 'globalusage-for' => '"$1" için küresel kullanım',
9321251 'globalusage-desc' => 'Küresel dosya kullanımını görmek için [[Special:GlobalUsage|özel sayfa]]',
9331252 'globalusage-ok' => 'Ara',
9341253 'globalusage-text' => 'Küresel dosya kullanımını ara.',
 1254+ 'globalusage-no-results' => '[[:$1]] diğer vikilerde kullanılmıyor.',
 1255+ 'globalusage-on-wiki' => '$2 üzerinde [[:File:$1|$1]] adlı dosyanın kullanımı',
 1256+ 'globalusage-of-file' => 'Bu dosya aşağıdaki diğer vikiler tarafından kullanılmaktadır:',
 1257+ 'globalusage-more' => 'Bu dosyanın [[{{#Special:GlobalUsage}}/$1|küresel kullanımını]] gör.',
 1258+ 'globalusage-filterlocal' => 'Yerel kullanımı gösterme',
9351259 );
9361260
 1261+/** Ukrainian (Українська)
 1262+ * @author NickK
 1263+ */
 1264+$messages['uk'] = array(
 1265+ 'globalusage' => 'Глобальне використання файлу',
 1266+ 'globalusage-for' => 'Глобальне використання «$1»',
 1267+ 'globalusage-desc' => '[[Special:GlobalUsage|Спеціальна сторінка]] для перегляду глобального використання файлу',
 1268+ 'globalusage-ok' => 'Пошук',
 1269+ 'globalusage-text' => 'Пошук глобального використання файлу',
 1270+ 'globalusage-no-results' => '[[:$1]] не використовується в інших вікі.',
 1271+ 'globalusage-on-wiki' => 'Використання [[:File:$1|$1]] в $2',
 1272+ 'globalusage-of-file' => 'Цей файл використовують такі інші вікі:',
 1273+ 'globalusage-more' => 'Переглянути [[{{#Special:GlobalUsage}}/$1|повний список глобального використання]] цього файлу.',
 1274+ 'globalusage-filterlocal' => 'Не показувати локальне використання',
 1275+);
 1276+
9371277 /** Vèneto (Vèneto)
9381278 * @author Candalua
9391279 */
9401280 $messages['vec'] = array(
 1281+ 'globalusage' => 'Utilizo globale de file',
 1282+ 'globalusage-for' => 'Utilizo globale de "$1"',
 1283+ 'globalusage-desc' => "[[Special:GlobalUsage|Pagina special]] par védar l'utilizo globale dei file",
9411284 'globalusage-ok' => 'Serca',
9421285 'globalusage-text' => 'Serca utilizo globale file',
 1286+ 'globalusage-no-results' => '[[:$1]] no xe mia doparà su de altre wiki.',
 1287+ 'globalusage-on-wiki' => 'Utilizo de [[:File:$1|$1]] su $2',
 1288+ 'globalusage-of-file' => "St'altre wiki qua le dòpara sto file:",
 1289+ 'globalusage-more' => 'Varda i [[{{#Special:GlobalUsage}}/$1|altri utilizi globali]] de sto file.',
 1290+ 'globalusage-filterlocal' => "No stà mostrar l'utilizo local",
9431291 );
9441292
9451293 /** Veps (Vepsan kel')
@@ -958,7 +1306,11 @@
9591307 'globalusage-desc' => '[[Special:GlobalUsage|Trang đặc biệt]] để xem tập tin này đang dùng ở đâu trên toàn hệ thống',
9601308 'globalusage-ok' => 'Tìm kiếm',
9611309 'globalusage-text' => 'Tìm cách dùng tập tin toàn cục.',
962 - 'globalusage-on-wiki' => 'Sử dụng [[:File:$1|$1]] tại $2',
 1310+ 'globalusage-no-results' => '[[:$1]] không được sử dụng tại các wiki khác.',
 1311+ 'globalusage-on-wiki' => '$2 sử dụng tại:',
 1312+ 'globalusage-of-file' => 'Các wiki sau đang sử dụng tập tin này:',
 1313+ 'globalusage-more' => 'Xem tập tin này [[{{#Special:GlobalUsage}}/$1|đang dùng ở đâu toàn hệ thống]].',
 1314+ 'globalusage-filterlocal' => 'Ẩn trang nội bộ sử dụng',
9631315 );
9641316
9651317 /** Volapük (Volapük)
@@ -980,16 +1332,36 @@
9811333 );
9821334
9831335 /** Simplified Chinese (‪中文(简体)‬)
 1336+ * @author Gaoxuewei
9841337 * @author Gzdavidwong
9851338 */
9861339 $messages['zh-hans'] = array(
 1340+ 'globalusage' => '全域文件使用情况',
 1341+ 'globalusage-for' => "全域 ''$1'' 使用情况",
 1342+ 'globalusage-desc' => '[[Special:GlobalUsage|特殊页面]]查看全域文件使用情况',
9871343 'globalusage-ok' => '搜索',
 1344+ 'globalusage-text' => '搜索全域文件使用情况',
 1345+ 'globalusage-no-results' => '[[:$1]]未在其他维基中使用。',
 1346+ 'globalusage-on-wiki' => '$2的使用情况',
 1347+ 'globalusage-of-file' => '本文件也在如下其他维基中使用:',
 1348+ 'globalusage-more' => '查看本文件的[[{{#Special:GlobalUsage}}/$1|更多全域使用情况]]。',
 1349+ 'globalusage-filterlocal' => '不要显示本地使用情况',
9881350 );
9891351
9901352 /** Traditional Chinese (‪中文(繁體)‬)
 1353+ * @author Gaoxuewei
9911354 * @author Wrightbus
9921355 */
9931356 $messages['zh-hant'] = array(
 1357+ 'globalusage' => '全域文件使用情況',
 1358+ 'globalusage-for' => "全域 ''$1'' 使用情況",
 1359+ 'globalusage-desc' => '[[Special:GlobalUsage|特殊頁面]]查看全域文件使用情況',
9941360 'globalusage-ok' => '搜尋',
 1361+ 'globalusage-text' => '搜索全域文件使用情況',
 1362+ 'globalusage-no-results' => '[[:$1]]未在其他維基中使用。',
 1363+ 'globalusage-on-wiki' => '$2的使用情況',
 1364+ 'globalusage-of-file' => '本文件也在如下其他維基中使用:',
 1365+ 'globalusage-more' => '查看本文件的[[{{#Special:GlobalUsage}}/$1|更多全域使用情況]]。',
 1366+ 'globalusage-filterlocal' => '不要顯示本地使用情況',
9951367 );
9961368
Index: branches/wmf-deployment/extensions/GlobalUsage/refreshGlobalimagelinks.php
@@ -1,6 +1,12 @@
22 <?php
3 -require_once( '../../maintenance/Maintenance.php' );
 3+$path = '../..';
44
 5+if ( getenv('MW_INSTALL_PATH') !== false ) {
 6+ $path = getenv('MW_INSTALL_PATH');
 7+}
 8+
 9+require_once( $path.'/maintenance/Maintenance.php' );
 10+
511 class RefreshGlobalImageLinks extends Maintenance {
612 public function __construct() {
713 parent::__construct();
@@ -8,23 +14,23 @@
915 $this->addOption( 'start-image', 'il_to of the image to start with' );
1016 $this->addOption( 'maxlag', 'Maximum replication lag', false, true );
1117 }
12 -
 18+
1319 public function execute() {
1420 global $wgGlobalUsageDatabase;
15 -
 21+
1622 $dbr = wfGetDB( DB_SLAVE );
17 - $gu = new GlobalUsage( wfWikiId(),
18 - wfGetDB( DB_MASTER, array(), $wgGlobalUsageDatabase ) );
19 -
 23+ $dbw = wfGetDB( DB_MASTER, array(), $wgGlobalUsageDatabase );
 24+ $gu = new GlobalUsage( wfWikiId(), $dbw );
 25+
2026 $lastPageId = intval( $this->getOption( 'start-page', 0 ) );
2127 $lastIlTo = $this->getOption( 'start-image' );
2228 $limit = 500;
23 - $maxlag = intval( $this->getOption( 'maxlag', 0 ) );
24 -
 29+ $maxlag = intval( $this->getOption( 'maxlag', 5 ) );
 30+
2531 do
2632 {
2733 $this->output( "Querying links after (page_id, il_to) = ($lastPageId, $lastIlTo)\n" );
28 -
 34+
2935 # Query all pages and any imagelinks associated with that
3036 $quotedLastIlTo = $dbr->addQuotes( $lastIlTo );
3137 $res = $dbr->select(
@@ -45,45 +51,48 @@
4652 # from all images, even if they don't have images anymore
4753 'imagelinks' => array( 'LEFT JOIN', 'page_id = il_from' ),
4854 # Check to see if images exist locally
49 - 'image' => array( 'LEFT JOIN', 'il_to = img_name' )
 55+ 'image' => array( 'LEFT JOIN', 'il_to = img_name' )
5056 )
5157 );
52 -
 58+
5359 # Build up a tree per pages
5460 $pages = array();
5561 $lastRow = null;
5662 foreach ( $res as $row ) {
5763 if ( !isset( $pages[$row->page_id] ) )
5864 $pages[$row->page_id] = array();
59 - # Add the imagelinks entry to the pages array if the image
60 - # does not exist locally
 65+ # Add the imagelinks entry to the pages array if the image
 66+ # does not exist locally
6167 if ( !is_null( $row->il_to ) && is_null( $row->img_name ) ) {
6268 $pages[$row->page_id][$row->il_to] = $row;
6369 }
6470 $lastRow = $row;
6571 }
66 -
 72+
6773 # Insert the imagelinks data to the global table
6874 foreach ( $pages as $pageId => $rows ) {
6975 # Delete all original links if this page is not a continuation
7076 # of last iteration.
7177 if ( $pageId != $lastPageId )
72 - $gu->deleteFrom( $pageId );
 78+ $gu->deleteLinksFromPage( $pageId );
7379 if ( $rows ) {
7480 $title = Title::newFromRow( reset( $rows ) );
7581 $images = array_keys( $rows );
76 - # Since we have a pretty accurate page_id, don't specify
 82+ # Since we have a pretty accurate page_id, don't specify
7783 # GAID_FOR_UPDATE
78 - $gu->setUsage( $title, $images, /* $flags */ 0 );
 84+ $gu->insertLinks( $title, $images, /* $flags */ 0 );
7985 }
8086 }
81 -
 87+
8288 if ( $lastRow ) {
83 - # We've processed some rows in this iteration, so save
 89+ # We've processed some rows in this iteration, so save
8490 # continuation variables
8591 $lastPageId = $lastRow->page_id;
8692 $lastIlTo = $lastRow->il_to;
87 - wfWaitForSlaves( $maxlag );
 93+
 94+ # Be nice to the database
 95+ $dbw->immediateCommit();
 96+ wfWaitForSlaves( $maxlag, $wgGlobalUsageDatabase );
8897 }
8998 } while ( !is_null( $lastRow ) );
9099 }
Index: branches/wmf-deployment/extensions/GlobalUsage/ApiQueryGlobalUsage.php
@@ -0,0 +1,136 @@
 2+<?php
 3+/**
 4+ * Created on November 8, 2009
 5+ *
 6+ * API for MediaWiki 1.8+
 7+ *
 8+ * Copyright (C) 2009 Bryan Tong Minh <bryan.tongminh@gmail.com>
 9+ *
 10+ * This program is free software; you can redistribute it and/or modify
 11+ * it under the terms of the GNU General Public License as published by
 12+ * the Free Software Foundation; either version 2 of the License, or
 13+ * (at your option) any later version.
 14+ *
 15+ * This program is distributed in the hope that it will be useful,
 16+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 18+ * GNU General Public License for more details.
 19+ *
 20+ * You should have received a copy of the GNU General Public License along
 21+ * with this program; if not, write to the Free Software Foundation, Inc.,
 22+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 23+ * http://www.gnu.org/copyleft/gpl.html
 24+ */
 25+
 26+if (!defined('MEDIAWIKI')) {
 27+ // Eclipse helper - will be ignored in production
 28+ require_once ( "ApiQueryBase.php" );
 29+}
 30+
 31+class ApiQueryGlobalUsage extends ApiQueryBase {
 32+ public function __construct( $query, $moduleName ) {
 33+ parent :: __construct( $query, $moduleName, 'gu' );
 34+ }
 35+
 36+ public function execute() {
 37+ $params = $this->extractRequestParams();
 38+
 39+ $pageIds = $this->getPageSet()->getAllTitlesByNamespace();
 40+ if ( !empty( $pageIds[NS_FILE] ) ) {
 41+ # Create a query and set parameters
 42+ $pageIds = $pageIds[NS_FILE];
 43+ $query = new GlobalUsageQuery( array_keys( $pageIds ) );
 44+ if ( !is_null( $params['continue'] ) ) {
 45+ if ( !$query->setOffset( $params['continue'] ) )
 46+ $this->dieUsage( 'Invalid continue parameter', 'badcontinue' );
 47+ }
 48+ $query->setLimit( $params['limit'] );
 49+ $query->filterLocal( $params['filterlocal'] );
 50+
 51+ # Execute the query
 52+ $query->execute();
 53+
 54+ # Create the result
 55+ $apiResult = $this->getResult();
 56+ foreach ( $query->getResult() as $image => $wikis ) {
 57+ $pageId = intval( $pageIds[$image] );
 58+ foreach ( $wikis as $wiki => $result ) {
 59+ foreach ( $result as $item ) {
 60+ if ( $item['namespace'] )
 61+ $title = "{$item['namespace']}:{$item['title']}";
 62+ else
 63+ $title = $item['title'];
 64+ $url = WikiMap::getForeignUrl( $item['wiki'], $title );
 65+ $fit = $apiResult->addValue( array(
 66+ 'query', 'pages', $pageId, 'globalusage'
 67+ ), null, array(
 68+ 'title' => $title,
 69+ 'url' => $url,
 70+ 'wiki' => WikiMap::getWikiName( $wiki )
 71+ ) );
 72+
 73+ if ( !$fit ) {
 74+ $continue = "{$item['image']}|{$item['wiki']}|{$item['id']}";
 75+ $this->setIndexedTagName();
 76+ $this->setContinueEnumParameter( 'continue', $continue );
 77+ return;
 78+ }
 79+ }
 80+ }
 81+ }
 82+ $this->setIndexedTagName();
 83+
 84+ if ( $query->hasMore() ) {
 85+ $this->setContinueEnumParameter( 'continue', $query->getContinueString() );
 86+ }
 87+ }
 88+ }
 89+
 90+ private function setIndexedTagName() {
 91+ $result = $this->getResult();
 92+ $pageIds = $this->getPageSet()->getAllTitlesByNamespace();
 93+ foreach ( $pageIds[NS_FILE] as $id ) {
 94+ $result->setIndexedTagName_internal(
 95+ array( 'query', 'pages', $id, 'globalusage' ),
 96+ 'gu'
 97+ );
 98+ }
 99+ }
 100+
 101+ public function getAllowedParams() {
 102+ return array(
 103+ 'limit' => array(
 104+ ApiBase :: PARAM_DFLT => 10,
 105+ ApiBase :: PARAM_TYPE => 'limit',
 106+ ApiBase :: PARAM_MIN => 1,
 107+ ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
 108+ ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
 109+ ),
 110+ 'continue' => null,
 111+ 'filterlocal' => false,
 112+ );
 113+ }
 114+
 115+ public function getParamDescription () {
 116+ return array(
 117+ 'limit' => 'How many links to return',
 118+ 'continue' => 'When more results are available, use this to continue',
 119+ 'filterlocal' => 'Filter local usage of the file',
 120+ );
 121+ }
 122+
 123+ public function getDescription() {
 124+ return 'Returns global image usage for a certain image';
 125+ }
 126+
 127+ protected function getExamples() {
 128+ return array (
 129+ "Get usage of File:Example.jpg:",
 130+ " api.php?action=query&prop=globalusage&titles=File:Example.jpg",
 131+ );
 132+ }
 133+
 134+ public function getVersion() {
 135+ return __CLASS__ . ': $Id$';
 136+ }
 137+}
\ No newline at end of file
Property changes on: branches/wmf-deployment/extensions/GlobalUsage/ApiQueryGlobalUsage.php
___________________________________________________________________
Name: svn:eol-style
1138 + native
Name: svn:keywords
2139 + Id
Index: branches/wmf-deployment/extensions/GlobalUsage/GlobalUsage.php
@@ -50,9 +50,12 @@
5151 $wgAutoloadClasses['GlobalUsage'] = $dir . 'GlobalUsage_body.php';
5252 $wgAutoloadClasses['GlobalUsageHooks'] = $dir . 'GlobalUsageHooks.php';
5353 $wgAutoloadClasses['SpecialGlobalUsage'] = $dir . 'SpecialGlobalUsage.php';
 54+$wgAutoloadClasses['GlobalUsageQuery'] = $dir . 'GlobalUsageQuery.php';
 55+$wgAutoloadClasses['ApiQueryGlobalUsage'] = $dir . 'ApiQueryGlobalUsage.php';
5456 $wgExtensionMessageFiles['GlobalUsage'] = $dir . 'GlobalUsage.i18n.php';
5557 $wgExtensionAliasesFiles['GlobalUsage'] = $dir . 'GlobalUsage.alias.php';
5658 $wgSpecialPages['GlobalUsage'] = 'SpecialGlobalUsage';
 59+$wgAPIPropModules['globalusage'] = 'ApiQueryGlobalUsage';
5760
5861 /* Things that can cause link updates:
5962 * - Local LinksUpdate
@@ -66,6 +69,7 @@
6770 $wgHooks['UploadComplete'][] = 'GlobalUsageHooks::onUploadComplete';
6871 $wgHooks['TitleMoveComplete'][] = 'GlobalUsageHooks::onTitleMoveComplete';
6972 $wgHooks['ImagePageAfterImageLinks'][] = 'SpecialGlobalUsage::onImagePageAfterImageLinks';
 73+$wgHooks['ImagePageShowTOC'][] = 'SpecialGlobalUsage::onImagePageShowTOC';
7074
7175
7276 // If set to false, the local database contains the globalimagelinks table
Index: branches/wmf-deployment/extensions/GlobalUsage/SpecialGlobalUsage.php
@@ -6,33 +6,33 @@
77 class SpecialGlobalUsage extends SpecialPage {
88 public function __construct() {
99 parent::__construct( 'GlobalUsage', 'globalusage' );
10 -
 10+
1111 wfLoadExtensionMessages( 'globalusage' );
1212 }
13 -
 13+
1414 /**
1515 * Entry point
1616 */
1717 public function execute( $par ) {
1818 global $wgOut, $wgRequest;
19 -
 19+
2020 $target = $par ? $par : $wgRequest->getVal( 'target' );
21 - $this->target = Title::newFromText( $target, NS_FILE );
22 -
 21+ $this->target = Title::makeTitleSafe( NS_FILE, $target );
 22+
2323 $this->filterLocal = $wgRequest->getCheck( 'filterlocal' );
24 -
 24+
2525 $this->setHeaders();
26 -
 26+
2727 $this->showForm();
28 -
 28+
2929 if ( is_null( $this->target ) )
3030 {
3131 $wgOut->setPageTitle( wfMsg( 'globalusage' ) );
32 - return;
 32+ return;
3333 }
34 -
 34+
3535 $wgOut->setPageTitle( wfMsg( 'globalusage-for', $this->target->getPrefixedText() ) );
36 -
 36+
3737 $this->showResult();
3838 }
3939
@@ -41,60 +41,76 @@
4242 */
4343 private function showForm() {
4444 global $wgScript, $wgOut;
45 -
 45+
4646 $html = Xml::openElement( 'form', array( 'action' => $wgScript ) ) . "\n";
4747 $html .= Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
48 - $formContent = "\t" . Xml::input( 'target', 40, is_null( $this->target ) ? ''
49 - : $this->target->getPrefixedText() )
50 - . "\n\t" . Xml::element( 'input', array(
51 - 'type' => 'submit',
 48+ $formContent = "\t" . Xml::input( 'target', 40, is_null( $this->target ) ? ''
 49+ : $this->target->getPrefixedText() )
 50+ . "\n\t" . Xml::element( 'input', array(
 51+ 'type' => 'submit',
5252 'value' => wfMsg( 'globalusage-ok' )
5353 ) )
5454 . "\n\t<p>" . Xml::checkLabel( wfMsg( 'globalusage-filterlocal' ),
55 - 'filterlocal', 'mw-filterlocal', $this->filterLocal ) . '</p>';
 55+ 'filterlocal', 'mw-filterlocal', $this->filterLocal ) . '</p>';
 56+ if ( !is_null( $this->target ) && wfFindFile( $this->target ) ) {
 57+ global $wgUser, $wgContLang;
 58+ $skin = $wgUser->getSkin();
 59+
 60+ $html .= $skin->makeImageLinkObj( $this->target,
 61+ $this->target->getPrefixedText(),
 62+ /* $alt */ '', /* $align */ $wgContLang->alignEnd(),
 63+ /* $handlerParams */ array(), /* $framed */ false,
 64+ /* $thumb */ true );
 65+ }
5666 $html .= Xml::fieldSet( wfMsg( 'globalusage-text' ), $formContent ) . "\n</form>";
57 -
 67+
5868 $wgOut->addHtml( $html );
5969 }
60 -
 70+
6171 /**
6272 * Creates as queryer and executes it based on $wgRequest
6373 */
6474 private function showResult() {
6575 global $wgRequest;
66 -
 76+
6777 $query = new GlobalUsageQuery( $this->target );
68 -
 78+
6979 // Extract params from $wgRequest
70 - $query->setContinue( $wgRequest->getInt( 'offset', 0 ) );
 80+ $query->setOffset( $wgRequest->getText( 'offset' ) );
7181 $query->setLimit( $wgRequest->getInt( 'limit', 50 ) );
7282 $query->filterLocal( $this->filterLocal );
73 -
 83+
7484 // Perform query
7585 $query->execute();
76 -
 86+
7787 // Show result
7888 global $wgOut;
79 -
80 - $navbar = wfViewPrevNext( $query->getOffset(), $query->getLimit(), $this->getTitle(),
81 - 'target=' . $this->target->getPrefixedText(), !$query->hasMore() );
 89+
 90+ // Don't show form element if there is no data
 91+ if ( $query->count() == 0 ) {
 92+ $wgOut->addWikiMsg( 'globalusage-no-results', $this->target->getPrefixedText() );
 93+ return;
 94+ }
 95+
 96+ $offset = $query->getOffsetString();
 97+ $navbar = $this->getNavBar( $query );
8298 $targetName = $this->target->getText();
83 -
 99+
84100 $wgOut->addHtml( $navbar );
85 -
 101+
86102 $wgOut->addHtml( '<div id="mw-globalusage-result">' );
87 - foreach ( $query->getResult() as $wiki => $result ) {
88 - $wgOut->addHtml(
89 - '<h2>' . wfMsgExt(
 103+ foreach ( $query->getSingleImageResult() as $wiki => $result ) {
 104+ $wgOut->addHtml(
 105+ '<h2>' . wfMsgExt(
90106 'globalusage-on-wiki', 'parseinline',
91 - $targetName, $wiki )
 107+ $targetName, WikiMap::getWikiName( $wiki ) )
92108 . "</h2><ul>\n" );
93109 foreach ( $result as $item )
94110 $wgOut->addHtml( "\t<li>" . self::formatItem( $item ) . "</li>\n" );
95111 $wgOut->addHtml( "</ul>\n" );
96112 }
97113 $wgOut->addHtml( '</div>' );
98 -
 114+
99115 $wgOut->addHtml( $navbar );
100116 }
101117 /**
@@ -106,154 +122,128 @@
107123 $page = $item['title'];
108124 else
109125 $page = "{$item['namespace']}:{$item['title']}";
110 -
111 - $wiki = WikiMap::getWiki( $item['wiki'] );
112 -
113 - return WikiMap::makeForeignLink( $item['wiki'],
 126+
 127+ return WikiMap::makeForeignLink( $item['wiki'], $page,
114128 str_replace( '_', ' ', $page ) );
115129 }
 130+
 131+
 132+ private static $queryCache = array();
 133+ /**
 134+ * Get an executed query for use on image pages
 135+ *
 136+ * @param Title $title File to query for
 137+ * @return GlobalUsageQuery Query object, already executed
 138+ */
 139+ private static function getImagePageQuery( $title ) {
 140+ $name = $title->getDBkey();
 141+ if ( !isset( self::$queryCache[$name] ) ) {
 142+ $query = new GlobalUsageQuery( $title );
 143+ $query->filterLocal();
 144+ $query->execute();
 145+
 146+ self::$queryCache[$name] = $query;
 147+
 148+ // Limit cache size to 100
 149+ if ( count( self::$queryCache ) > 100 )
 150+ array_shift( self::$queryCache );
 151+ }
 152+
 153+ return self::$queryCache[$name];
 154+ }
116155
117156 public static function onImagePageAfterImageLinks( $imagePage, &$html ) {
118157 $title = $imagePage->getFile()->getTitle();
119158 $targetName = $title->getText();
120 -
121 - $query = new GlobalUsageQuery( $title );
122 - $query->filterLocal();
123 - $query->execute();
124 -
 159+
 160+ $query = self::getImagePageQuery( $title );
 161+
125162 $guHtml = '';
126 - foreach ( $query->getResult() as $wiki => $result ) {
 163+ foreach ( $query->getSingleImageResult() as $wiki => $result ) {
127164 $guHtml .= '<li>' . wfMsgExt(
128165 'globalusage-on-wiki', 'parseinline',
129 - $targetName, $wiki ) . "\n<ul>";
 166+ $targetName, WikiMap::getWikiName( $wiki ) ) . "\n<ul>";
130167 foreach ( $result as $item )
131168 $guHtml .= "\t<li>" . self::formatItem( $item ) . "</li>\n";
132169 $guHtml .= "</ul></li>\n";
133170 }
134 -
 171+
135172 if ( $guHtml ) {
136 - $html .= "<h2>" . wfMsgHtml( 'globalusage' ) . "</h2>\n"
 173+ $html .= '<h2 id="globalusage">' . wfMsgHtml( 'globalusage' ) . "</h2>\n"
137174 . wfMsgExt( 'globalusage-of-file', 'parse' )
138175 . "<ul>\n" . $guHtml . "</ul>\n";
139176 if ( $query->hasMore() )
140177 $html .= wfMsgExt( 'globalusage-more', 'parse', $targetName );
141178 }
142179
143 -
 180+
144181 return true;
145182 }
146 -}
147183
148 -
149 -
150 -/**
151 - * A helper class to query the globalimagelinks table
152 - *
153 - * Should maybe simply resort to offset/limit query rather
154 - */
155 -class GlobalUsageQuery {
156 - private $limit = 50;
157 - private $offset = 0;
158 - private $hasMore = false;
159 - private $filterLocal = false;
160 - private $result;
161 -
162 -
163 - public function __construct( $target ) {
164 - global $wgGlobalUsageDatabase;
165 - $this->db = wfGetDB( DB_SLAVE, array(), $wgGlobalUsageDatabase );
166 - $this->target = $target;
167 -
168 - }
169 -
170184 /**
171 - * Set the offset parameter
172 - *
173 - * @param $offset int offset
 185+ * Show a link to the global image links in the TOC if there are any results available.
174186 */
175 - public function setContinue( $offset ) {
176 - $this->offset = $offset;
 187+ public static function onImagePageShowTOC( $imagePage, &$toc ) {
 188+ $query = self::getImagePageQuery( $imagePage->getFile()->getTitle() );
 189+ if ( $query->getResult() )
 190+ $toc[] = '<li><a href="#globalusage">' . wfMsgHtml( 'globalusage' ) . '</a></li>';
 191+ return true;
177192 }
178 - /**
179 - * Return the offset set by the user
180 - *
181 - * @return int offset
182 - */
183 - public function getOffset() {
184 - return $this->offset;
185 - }
186 - /**
187 - * Set the maximum amount of items to return. Capped at 500.
188 - *
189 - * @param $limit int The limit
190 - */
191 - public function setLimit( $limit ) {
192 - $this->limit = min( $limit, 500 );
193 - }
194 - public function getLimit() {
195 - return $this->limit;
196 - }
197 -
198 - /**
199 - * Set whether to filter out the local usage
200 - */
201 - public function filterLocal( $value = true ) {
202 - $this->filterLocal = $value;
203 - }
204 -
205 -
206 - /**
207 - * Executes the query
208 - */
209 - public function execute() {
210 - $where = array( 'gil_to' => $this->target->getDBkey() );
211 - if ( $this->filterLocal )
212 - $where[] = 'gil_wiki != ' . $this->db->addQuotes( wfWikiId() );
213 -
214 - $res = $this->db->select( 'globalimagelinks',
215 - array(
216 - 'gil_wiki',
217 - 'gil_page',
218 - 'gil_page_namespace',
219 - 'gil_page_title'
220 - ),
221 - $where,
222 - __METHOD__,
223 - array(
224 - 'ORDER BY' => 'gil_wiki, gil_page',
225 - 'LIMIT' => $this->limit + 1,
226 - 'OFFSET' => $this->offset,
227 - )
228 - );
229 -
230 - $count = 0;
231 - $this->hasMore = false;
232 - $this->result = array();
233 - foreach ( $res as $row ) {
234 - $count++;
235 - if ( $count > $this->limit ) {
236 - $this->hasMore = true;
237 - break;
238 - }
239 - if ( !isset( $this->result[$row->gil_wiki] ) )
240 - $this->result[$row->gil_wiki] = array();
241 - $this->result[$row->gil_wiki][] = array(
242 - 'namespace' => $row->gil_page_namespace,
243 - 'title' => $row->gil_page_title,
244 - 'wiki' => $row->gil_wiki,
245 - );
 193+
 194+ protected function getNavBar( $query ) {
 195+ global $wgLang, $wgUser;
 196+
 197+ $skin = $wgUser->getSkin();
 198+
 199+ $target = $this->target->getPrefixedText();
 200+ $limit = $query->getLimit();
 201+ $fmtLimit = $wgLang->formatNum( $limit );
 202+ $offset = $query->getOffsetString();
 203+ if ( $offset == '||' )
 204+ $offset = '';
 205+
 206+ # Get prev/next link display text
 207+ $prev = wfMsgExt( 'prevn', array('parsemag','escape'), $fmtLimit );
 208+ $next = wfMsgExt( 'nextn', array('parsemag','escape'), $fmtLimit );
 209+ # Get prev/next link title text
 210+ $pTitle = wfMsgExt( 'prevn-title', array('parsemag','escape'), $fmtLimit );
 211+ $nTitle = wfMsgExt( 'nextn-title', array('parsemag','escape'), $fmtLimit );
 212+
 213+ # Fetch the title object
 214+ $title = $this->getTitle();
 215+
 216+ # Make 'previous' link
 217+ if ( $offset ) {
 218+ $attr = array( 'title' => $pTitle, 'class' => 'mw-prevlink' );
 219+ $q = array( 'limit' => $limit, 'offset' => $offset, 'target' => $target );
 220+ $plink = $skin->link( $title, $prev, $attr, $q );
 221+ } else {
 222+ $plink = $prev;
246223 }
 224+
 225+ # Make 'next' link
 226+ if ( $query->hasMore() ) {
 227+ $attr = array( 'title' => $nTitle, 'class' => 'mw-nextlink' );
 228+ $q = array( 'limit' => $limit, 'offset' => $query->getContinueString(), 'target' => $target );
 229+ $nlink = $skin->link( $title, $next, $attr, $q );
 230+ } else {
 231+ $nlink = $next;
 232+ }
 233+
 234+ # Make links to set number of items per page
 235+ $numLinks = array();
 236+ foreach ( array( 20, 50, 100, 250, 500 ) as $num ) {
 237+ $fmtLimit = $wgLang->formatNum( $num );
 238+
 239+ $q = array( 'offset' => $offset, 'limit' => $num, 'target' => $target );
 240+ $lTitle = wfMsgExt( 'shown-title', array( 'parsemag', 'escape' ), $num );
 241+ $attr = array( 'title' => $lTitle, 'class' => 'mw-numlink' );
 242+
 243+ $numLinks[] = $skin->link( $title, $fmtLimit, $attr, $q );
 244+ }
 245+ $nums = $wgLang->pipeList( $numLinks );
 246+
 247+ return wfMsgHtml( 'viewprevnext', $plink, $nlink, $nums );
247248 }
248 - public function getResult() {
249 - return $this->result;
250 - }
251 -
252 - /**
253 - * Returns whether there are more results
254 - *
255 - * @return bool
256 - */
257 - public function hasMore() {
258 - return $this->hasMore;
259 - }
260249 }
 250+
Property changes on: branches/wmf-deployment/extensions/GlobalUsage
___________________________________________________________________
Name: svn:mergeinfo
261251 - /branches/REL1_15/phase3/extensions/GlobalUsage:51646
/trunk/extensions/GlobalUsage:56207,56209,56296,56333,56355,58660-58739,58752
/trunk/phase3/extensions/GlobalUsage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816
262252 + /branches/REL1_15/phase3/extensions/GlobalUsage:51646
/trunk/extensions/GlobalUsage:56207,56209,56296,56333,56355,58660-60605
/trunk/phase3/extensions/GlobalUsage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816

Status & tagging log