From 111fd984ce5f7482e1ba28c966b7be65e8d77888 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 18 Jan 2017 19:31:29 +0700 Subject: [PATCH] English version hooray --- IUT.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/IUT.js b/IUT.js index 3f4e155..393f001 100644 --- a/IUT.js +++ b/IUT.js @@ -16,6 +16,13 @@ var IUT = function IUT() { this.id = 0; this.last_id = 0; this.imagePath = mw.config.get( 'wgExtensionAssetsPath' ) + '/VoteNY/images/'; + $.when( mw.loader.using( [ 'mediawiki.api.messages', 'mediawiki.jqueryMsg' ] ), $.ready ).then( function() { + return new mw.Api().loadMessagesIfMissing( [ + 'iusethis-unvote-link', + 'iusethis-link', + 'people-count' + ] ); + }) /** * Called when voting through the green square voting box @@ -30,9 +37,9 @@ var IUT = function IUT() { what: 'vote', pageId: PageID } ).done( function( data ) { - $( '#PollVotes' ).html( data.iusethis.result ); + $( '#PollVotes' ).html( data.iusethis.result + ' ' + mw.msg('people-count') ); $( '#Answer' ).html( - '' + + ' ' + mw.msg( 'iusethis-unvote-link' ) + '' ); } ); @@ -50,9 +57,9 @@ var IUT = function IUT() { what: 'delete', pageId: PageID } ).done( function( data ) { - $( '#PollVotes' ).html( data.iusethis.result ); + $( '#PollVotes' ).html( data.iusethis.result + ' ' + mw.msg('people-count') ); $( '#Answer' ).html( - '' + + ' ' + mw.msg( 'iusethis-link' ) + '' ); } );