jenkins-bot has submitted this change and it was merged.

Change subject: Add Plural support for googlelogin-manage-linked
......................................................................


Add Plural support for googlelogin-manage-linked

Bug: T138137
Change-Id: I3d332983986fc3dced3e4a1fe2907d71d225944e
---
M i18n/en.json
M i18n/qqq.json
M includes/specials/SpecialManageGoogleLogin.php
3 files changed, 16 insertions(+), 17 deletions(-)

Approvals:
  Siebrand: Looks good to me, but someone else must approve
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index a235622..f73edb6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -12,7 +12,7 @@
        "googlelogin-managelegend": "Find user to manage",
        "googlelogin-manage-usersubmit": "Manage user",
        "googlelogin-manage-user": "You manage the {{GENDER:$1|user}} 
<strong>$1</strong>.",
-       "googlelogin-manage-linked": "The account is linked with Google 
account(s) with the following ID(s): ",
+       "googlelogin-manage-linked": "The account is linked with {{PLURAL:$1|a 
Google account|Google accounts}} with the following {{PLURAL:$1|ID|IDs}}: ",
        "googlelogin-manage-notlinked": "The account is actually not linked 
with any Google account.",
        "googlelogin-manage-changelegend": "Change Google ID",
        "googlelogin-manage-noplus": "<strong>Notice:</strong> The user with 
the Google ID you entered seems to have no Google+ profile. Maybe a typing 
error?",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 5e5fa50..324ef08 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -17,7 +17,7 @@
        "googlelogin-managelegend": "Text used in legend on 
Special:ManageGoogleLogin.",
        "googlelogin-manage-usersubmit": "Submit text for find user form on 
Special:ManageGoogleLogin.",
        "googlelogin-manage-user": "Used on Special:ManageGoogleLogin to show, 
which user is managed.\n* $1 - The name of the managed user, used for GENDER",
-       "googlelogin-manage-linked": "Message, that indicates, that the Wiki 
user is linked with a Google account.\n* $1 - Google ID of the linked Google 
account",
+       "googlelogin-manage-linked": "Message, that indicates, that the Wiki 
user is linked with one or more Google account(s).\n* $1 - Number of Google 
accounts (used for PLURAL support only)",
        "googlelogin-manage-notlinked": "Message that indicates, that the Wiki 
user isn't linked with a Google account.",
        "googlelogin-manage-changelegend": "Legendmessage for the \"Change 
Google ID\" form on Special:ManageGoogleLogin.",
        "googlelogin-manage-noplus": "Notice message, that the passed Google ID 
doesn't have a Plus profile, including a hint to check a typing error.",
diff --git a/includes/specials/SpecialManageGoogleLogin.php 
b/includes/specials/SpecialManageGoogleLogin.php
index ff0ccbd..cafe07e 100644
--- a/includes/specials/SpecialManageGoogleLogin.php
+++ b/includes/specials/SpecialManageGoogleLogin.php
@@ -102,26 +102,25 @@
                $out->addWikiMsg( 'googlelogin-manage-user', $user->getName() );
                $googleIds = GoogleUser::getGoogleIdFromUser( $user );
                if ( $googleIds ) {
-                       $out->addHTML(
-                               Html::openElement( 'div' ) .
-                               $this->msg( 'googlelogin-manage-linked' 
)->escaped() .
-                               Html::openElement( 'strong' )
-                       );
-
+                       $googleIdLinks = '';
                        foreach ( $googleIds as $count => $googleId ) {
+                               $googleIdCount = $count + 1;
                                if ( $count !== 0 ) {
-                                       $out->addHTML( ', ' );
+                                       $googleIdLinks .= ', ';
                                }
-                               $out->addHTML(
-                                       Html::element( 'a',
-                                               [
-                                                       'href' => 
'javascript:void(0)',
-                                                       'data-googleid' => 
$googleId,
-                                               ],
-                                               $googleId
-                                       ) );
+                               $googleIdLinks .= Html::element( 'a',
+                                       [
+                                               'href' => 'javascript:void(0)',
+                                               'data-googleid' => $googleId,
+                                       ],
+                                       $googleId
+                               );
                        }
                        $out->addHTML(
+                               Html::openElement( 'div' ) .
+                               $this->msg( 'googlelogin-manage-linked', 
$googleIdCount )->escaped() .
+                               Html::openElement( 'strong' ) .
+                               $googleIdLinks .
                                Html::closeElement( 'strong' ) .
                                Html::closeElement( 'div' )
                        );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d332983986fc3dced3e4a1fe2907d71d225944e
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/GoogleLogin
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Purodha <puro...@blissenbach.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to