Henning Snater has uploaded a new change for review.

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


Change subject: Correctly accessing entity object for anon edit warning
......................................................................

Correctly accessing entity object for anon edit warning

Change I40bcc945610fe6f32e89fc12ea3b0def3126317a caused building a wrong 
message key
for the anonymous edit warning. This change set adds a default edit warning as 
fallback.
Probably there should only be one message with the entity type being a message 
parameter.

Change-Id: Ib3eddeffcda90f5ffe9f86bff968c00af34dd4ff
---
M repo/Wikibase.i18n.php
M repo/resources/wikibase.ui.entityViewInit.js
2 files changed, 16 insertions(+), 1 deletion(-)


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

diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index 5ba1e77..7a7c086 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -90,6 +90,8 @@
 
        'wikibase-entityselector-more' => 'more',
 
+       'wikibase-anonymouseditwarning' => "Warning: You are not logged in.
+Your IP address will be recorded in the edit history.",
        'wikibase-anonymouseditwarning-item' => "Warning: You are not logged in.
 Your IP address will be recorded in this item's edit history.",
        'wikibase-anonymouseditwarning-property' => "Warning: You are not 
logged in.
@@ -451,17 +453,26 @@
        'wikibase-copyrighttooltip-acknowledge' => 'Label of the link to not 
show the copyright warning again. A copyright warning is presented to the user 
whenever the user is about to alter any data unless the warning is not 
suppressed permanently by clicking this link.',
        'wikibase-entityselector-more' => 'The entity selector is a user 
interface widget that allows selecting an entity (see [[d:Wikidata/Glossary]]). 
It consists out of an input field and a list of suggestions that is filled 
according to the text typed into the input field. Initially, the list of 
suggestions is filled with a certain number of suggestions. Clicking the link 
labeled with this message will fill the list of suggestions with additional 
suggestions. If there are no additional suggestions or no suggestions at all, 
the link does not show up.
 {{Identical|More}}',
+       'wikibase-anonymouseditwarning' => 'Default warning message that is 
displayed using the MediaWiki notification system each time the user starts to 
edit something on an entity (see [[d:Wikidata/Glossary]]) page (e.g. by 
clicking an edit button). Basically, the message shall make the user aware that 
his/her IP will be recorded when saving as long as not being logged in. This 
default message is displayed only when there is no warning message specific for 
the entity.
+
+See also:
+* {{msg-mw|Anoneditwarning}}
+* {{msg-mw|Sf autoedit anoneditwarning}}
+* {{msg-mw|Wikibase-anonymouseditwarning-item}}
+* {{msg-mw|Wikibase-anonymouseditwarning-property}}',
        'wikibase-anonymouseditwarning-item' => 'Warning message that is 
displayed using the MediaWiki notification system each time the user starts to 
edit something on an item (see [[d:Wikidata/Glossary]]) page (e.g. by clicking 
an edit button). Basically, the message shall make the user aware that his/her 
IP will be recorded when saving as long as not being logged in.
 
 See also:
 * {{msg-mw|Anoneditwarning}}
 * {{msg-mw|Sf autoedit anoneditwarning}}
+* {{msg-mw|Wikibase-anonymouseditwarning}}
 * {{msg-mw|Wikibase-anonymouseditwarning-property}}',
        'wikibase-anonymouseditwarning-property' => 'Warning message that is 
displayed using the MediaWiki notification system each time the user starts to 
edit something on a property (see [[d:Wikidata/Glossary]]) page (e.g. by 
clicking an edit button). Basically, the message shall make the user aware that 
his/her IP will be recorded when saving as long as not being logged in.
 
 See also:
 * {{msg-mw|Anoneditwarning}}
 * {{msg-mw|Sf autoedit anoneditwarning}}
+* {{msg-mw|Wikibase-anonymouseditwarning}}
 * {{msg-mw|Wikibase-anonymouseditwarning-item}}',
        'wikibase-restrictionedit-tooltip-message' => 'When editing a page (a 
data item) is restricted for the current user, this message is displayed in a 
tooltip bubble when hovering a tooltip anchor next to an input element, an edit 
button or any other button (add, save, remove) that might trigger an action 
altering the data item.',
        'wikibase-blockeduser-tooltip-message' => 'When the current user is 
blocked from editing a page (a data item), this message is displayed in a 
tooltip bubble when hovering a tooltip anchor next to an input element, an edit 
button or any other button (add, save, remove) that might trigger an action 
altering the data item or creating a new item.',
diff --git a/repo/resources/wikibase.ui.entityViewInit.js 
b/repo/resources/wikibase.ui.entityViewInit.js
index b339a11..7edf079 100644
--- a/repo/resources/wikibase.ui.entityViewInit.js
+++ b/repo/resources/wikibase.ui.entityViewInit.js
@@ -177,7 +177,11 @@
 
                        // Display anonymous user edit warning:
                        if ( mw.user && mw.user.isAnon() ) {
-                               mw.notify( mw.message( 
'wikibase-anonymouseditwarning-' + wb.entity.type ) );
+                               var warningMessageKey =
+                                       ( mw.messages.get( 
'wikibase-anonymouseditwarning-' + wb.entity.getType() ) )
+                                       ? 'wikibase-anonymouseditwarning-' + 
wb.entity.getType()
+                                       : 'wikibase-anonymouseditwarning';
+                               mw.notify( mw.msg( warningMessageKey ) );
                        }
 
                        // add copyright warning to 'save' button if there is 
one:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3eddeffcda90f5ffe9f86bff968c00af34dd4ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <[email protected]>

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

Reply via email to