Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/295179
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(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleLogin refs/changes/79/295179/1 diff --git a/i18n/en.json b/i18n/en.json index a235622..b3ffcf3 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 {{PLURAL:$1|account|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..3a439c5 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() . + $googleIdLinks . + Html::openElement( 'strong' ) . 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: newchange Gerrit-Change-Id: I3d332983986fc3dced3e4a1fe2907d71d225944e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GoogleLogin Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits