[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Made strings "name" and "badges" translatable

2017-01-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/329635 )

Change subject: Made strings "name" and "badges" translatable
..


Made strings "name" and "badges" translatable

Strings "name" and "badges" has been made translatable in Item Diff page.

Bug: T111016
Change-Id: I2f53b0e99c72a066599c1117a29541606991930a
---
M repo/i18n/en.json
M repo/i18n/qqq.json
M repo/includes/Diff/DiffView.php
M repo/includes/Diff/EntityDiffVisualizer.php
M repo/tests/phpunit/includes/Diff/EntityDiffVisualizerTest.php
5 files changed, 41 insertions(+), 12 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 89a388f..e320726 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -62,6 +62,8 @@
"wikibase-diffview-alias": "aliases",
"wikibase-diffview-description": "description",
"wikibase-diffview-link": "links",
+   "wikibase-diffview-link-name": "name",
+   "wikibase-diffview-link-badges": "badges",
"wikibase-sitelink-site-edit-placeholder": "wiki",
"wikibase-sitelink-page-edit-placeholder": "page",
"wikibase-alias-edit-placeholder": "enter an alias",
diff --git a/repo/i18n/qqq.json b/repo/i18n/qqq.json
index 018dc7d..a0c5c74 100644
--- a/repo/i18n/qqq.json
+++ b/repo/i18n/qqq.json
@@ -92,7 +92,9 @@
"wikibase-diffview-label": "Sub heading for label changes in a 
diff.\n{{Identical|Label}}",
"wikibase-diffview-alias": "Sub heading for alias changes in a 
diff\n{{Identical|Alias}}",
"wikibase-diffview-description": "Sub heading for description changes 
in a diff.\n{{Identical|Description}}",
-   "wikibase-diffview-link": "Sub heading for link changes in a 
diff.\n{{Identical|Link}}",
+   "wikibase-diffview-link": "Sub heading for sitelink changes in a 
diff.\n{{Identical|Link}}",
+   "wikibase-diffview-link-name": "Sub heading for changes to the name of 
a sitelink in a diff.",
+   "wikibase-diffview-link-badges": "Sub heading for changes to the badges 
of a sitelink in a diff.",
"wikibase-sitelink-site-edit-placeholder": "[[File:Screenshot 
WikidataRepo 2012-05-13 E.png|right|0x150px]]\nThis is a generic text used as a 
placeholder while defining the site for a new sitelink. See also the Wikidata 
glossary on [[d:Wikidata:Glossary#sitelink|sitelink]].\n{{Identical|Wiki}}",
"wikibase-sitelink-page-edit-placeholder": "[[File:Screenshot 
WikidataRepo 2012-05-13 E.png|right|0x150px]]\nThis is a generic text used as a 
placeholder while defining the page for a possibly new sitelink. See also the 
Wikidata glossary on 
[[d:Wikidata:Glossary#sitelink|sitelink]].\n{{Identical|Page}}",
"wikibase-alias-edit-placeholder": "This is a generic placeholder 
message used while editing the list of aliases of an item. It is displayed in 
an empty input box which can be used to define a new alias.",
diff --git a/repo/includes/Diff/DiffView.php b/repo/includes/Diff/DiffView.php
index b59d0ac..317bac5 100644
--- a/repo/includes/Diff/DiffView.php
+++ b/repo/includes/Diff/DiffView.php
@@ -52,6 +52,11 @@
private $entityIdFormatter;
 
/**
+* @var string
+*/
+   private $siteLinkPath;
+
+   /**
 * @since 0.1
 *
 * @param string[] $path
@@ -75,6 +80,8 @@
if ( !is_null( $contextSource ) ) {
$this->setContext( $contextSource );
}
+
+   $this->siteLinkPath = $this->msg( 'wikibase-diffview-link' 
)->text();
}
 
/**
@@ -99,7 +106,17 @@
 */
private function generateOpHtml( array $path, DiffOp $op ) {
if ( $op->isAtomic() ) {
-   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$path ) );
+   $localizedPath = $path;
+
+   if ( $this->isSiteLinkPath( $path ) && isset( $path[2] 
) ) {
+   $translatedLinkSubPath = $this->msg( 
'wikibase-diffview-link-' . $path[2] );
+
+   if ( !$translatedLinkSubPath->isDisabled() ) {
+   $localizedPath[2] = 
$translatedLinkSubPath->text();
+   }
+   }
+
+   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$localizedPath ) );
 
//TODO: no path, but localized section title
 
@@ -188,7 +205,7 @@
 */
private function getChangedLine( $tag, $value, array $path ) {
// @todo: inject a formatter instead of doing special cases 
based on the path here!
-   if ( $path[0] === $this->getLanguage()->getMessage( 
'wikibase-diffview-link' ) ) {
+   if ( 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Made strings "name" and "badges" translatable

2016-12-29 Thread Subins2000 (Code Review)
Subins2000 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329635 )

Change subject: Made strings "name" and "badges" translatable
..

Made strings "name" and "badges" translatable

Strings "name" and "badges" has been made translatable in Item Diff page.

Bug: T111016
Change-Id: I2f53b0e99c72a066599c1117a29541606991930a
---
M repo/i18n/en.json
M repo/i18n/ml.json
M repo/includes/Diff/DiffView.php
3 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/35/329635/1

diff --git a/repo/i18n/en.json b/repo/i18n/en.json
index 2887a99..b66a139 100644
--- a/repo/i18n/en.json
+++ b/repo/i18n/en.json
@@ -59,6 +59,8 @@
"wikibase-diffview-alias": "aliases",
"wikibase-diffview-description": "description",
"wikibase-diffview-link": "links",
+   "wikibase-diffview-name": "name",
+   "wikibase-diffview-badges": "badges",
"wikibase-sitelink-site-edit-placeholder": "wiki",
"wikibase-sitelink-page-edit-placeholder": "page",
"wikibase-alias-edit-placeholder": "enter an alias",
diff --git a/repo/i18n/ml.json b/repo/i18n/ml.json
index 199e2fa..9d3406e 100644
--- a/repo/i18n/ml.json
+++ b/repo/i18n/ml.json
@@ -43,6 +43,8 @@
"wikibase-diffview-alias": "അപരനാമങ്ങൾ",
"wikibase-diffview-description": "വിവരണം",
"wikibase-diffview-link": "കണ്ണികൾ",
+   "wikibase-diffview-name": "പേര് ",
+   "wikibase-diffview-badges": "ബാഡ്ജുകൾ",
"wikibase-sitelink-site-edit-placeholder": "സൈറ്റ്",
"wikibase-sitelink-page-edit-placeholder": "താൾ",
"wikibase-alias-edit-placeholder": "ഒരു അപരനാമം നൽകുക",
diff --git a/repo/includes/Diff/DiffView.php b/repo/includes/Diff/DiffView.php
index b59d0ac..0e9d799 100644
--- a/repo/includes/Diff/DiffView.php
+++ b/repo/includes/Diff/DiffView.php
@@ -99,7 +99,13 @@
 */
private function generateOpHtml( array $path, DiffOp $op ) {
if ( $op->isAtomic() ) {
-   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$path ) );
+   $translatedPath = $path;
+
+   if($path[0] === $this->getLanguage()->getMessage( 
'wikibase-diffview-link' )){
+   $translatedPath[2] = 
$this->getLanguage()->getMessage( 'wikibase-diffview-' . $path[2] );
+   }
+
+   $html = $this->generateDiffHeaderHtml( implode( ' / ', 
$translatedPath ) );
 
//TODO: no path, but localized section title
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f53b0e99c72a066599c1117a29541606991930a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Subins2000 

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