Matthias Mullie has uploaded a new change for review.

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

Change subject: Address i18n issue
......................................................................

Address i18n issue

Raised on 
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Creditssource-source-work/ksh

Change-Id: I295a9bd23fe835762a6aa41e0d20ac26e86f591b
---
M CreditsSource.i18n.php
M CreditsSource_body.php
2 files changed, 22 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CreditsSource 
refs/changes/58/112958/1

diff --git a/CreditsSource.i18n.php b/CreditsSource.i18n.php
index 1002c2a..4f6aed5 100644
--- a/CreditsSource.i18n.php
+++ b/CreditsSource.i18n.php
@@ -10,8 +10,7 @@
 
 $messages['en'] = array(
        'creditssource-desc'            => 'Display source work credits in the 
page footer',
-       'creditssource-source-work'     => 'This page is derived from the page 
$1 on $2 in its revision from $6 at $7 (UTC). There, it is published under the 
CC BY-SA 3.0 license. More details and the full list of contributors can be 
found on the associated $5. Wikitravel contributors are marked by the prefix 
$4.',
-       'creditssource-historypage'     => 'history page',
+       'creditssource-credits'         => 'This page is derived from the page 
[$1 $2] on [$3 $4] in its revision from $8 at $9 (UTC). There, it is published 
under the CC BY-SA 3.0 license. More details and the full list of contributors 
can be found on the associated [[$5|history page]]. Wikitravel contributors are 
marked by the prefix $6.',
        'creditssource-creditpage'      => 'Gives credits for sourceworks.',
 );
 
@@ -22,20 +21,19 @@
  */
 $messages['qqq'] = array(
        'creditssource-desc' => '{{desc|name=Credits 
Source|url=http://www.mediawiki.org/wiki/Extension:CreditsSource}}',
-       'creditssource-source-work' => 'Parameters:
-* $1 - an external link to the source. Its link text is page title.
-* $2 - an external link to the site. Its link text is site name.
-* $3 - (Unused) timestamp (time and date)
-* $4 - a short name of the site Wikitravel
-* $5 - a link to the history page. Its link text is 
{{msg-mw|Creditssource-historypage}}.
-* $6 - a date
-* $7 - a time
+       'creditssource-credits' => 'Parameters:
+* $1 - an external url to the source; can be used to construct a link like: 
[$1 $2]
+* $2 - title of the external source
+* $3 - an external url to the site; can be used to construct a link like: [$3 
$4]
+* $4 - title of the external site
+* $5 - a relative url that points to History page of the specified page; can 
be used to construct a link [[$5|like this]]
+* $6 - a short name of the site Wikitravel
+* $7 - time and date timestamp
+* $8 - a date
+* $9 - a time
 If translation around $2 depends on the morphology, you have two options:
 # Do not translate in your language.
 # Make a translation that does work in your language. I suggest "the site 
SITENAME".',
-       'creditssource-historypage' => 'Used as link anchor text.
-
-The link points to History page of the specified page.',
        'creditssource-creditpage' => 'Description to be displayed on the 
credits action page.',
 );
 
diff --git a/CreditsSource_body.php b/CreditsSource_body.php
index fd1b10c..8b8d472 100644
--- a/CreditsSource_body.php
+++ b/CreditsSource_body.php
@@ -48,23 +48,20 @@
                $user = $this->getUser();
 
                foreach ( $sourceWorks as $source ) {
-                       $sourceLink = Linker::makeExternalLink( $source->mUri, 
$source->mTitle );
-                       $siteLink = Linker::makeExternalLink( 
$source->mSiteUri, $source->mSiteName );
-                       $historyLink = Linker::linkKnown(
-                               $this->getTitle(),
-                               wfMessage( 'creditssource-historypage' 
)->text(),
-                               array(),
-                               array( 'action' => 'history' )
-                       );
-
                        // This is safe, since we don't allow writing to the 
swsite tables. If that
                        // changes in the future, mSiteShortName will need to 
be escaped here.
-                       $return .= wfMessage( 'creditssource-source-work' 
)->params(
-                               $sourceLink,
-                               $siteLink,
-                               $lang->userTimeAndDate( $source->mTs, $user ),
+                       $return .= wfMessage( 'creditssource-credits' )->params(
+                               // source link (absolute) url + title
+                               $source->mUri,
+                               $source->mTitle,
+                               // site link (absolute) url + title
+                               $source->mSiteUri,
+                               $source->mSiteName,
+                               // history link internal (relative) url
+                               $this->getTitle()->getLocalURL( array( 'action' 
=> 'history' ) ),
+
                                $source->mSiteShortName,
-                               $historyLink,
+                               $lang->userTimeAndDate( $source->mTs, $user ),
                                $lang->userDate( $source->mTs, $user ),
                                $lang->userTime( $source->mTs, $user )
                        )->text();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I295a9bd23fe835762a6aa41e0d20ac26e86f591b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CreditsSource
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to