Ryan10145 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/398174 )
Change subject: Added Localization for CX Translation Trend Graph ...................................................................... Added Localization for CX Translation Trend Graph Bug: T94020 Change-Id: I24e74564b8ec8bbad7248462aea8f8a9ddd313b6 --- M modules/stats/ext.cx.stats.js 1 file changed, 40 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/74/398174/1 diff --git a/modules/stats/ext.cx.stats.js b/modules/stats/ext.cx.stats.js index 17c22d9..52af9b6 100644 --- a/modules/stats/ext.cx.stats.js +++ b/modules/stats/ext.cx.stats.js @@ -19,6 +19,7 @@ this.languageTranslationTrend = null; this.$highlights = null; this.$graph = null; + this.chartOptions = {}; } CXStats.prototype.init = function () { @@ -47,6 +48,41 @@ self.renderHighlights(); self.render(); } ); + + this.chartOptions = { + scales: { + xAxes: [ + { + ticks: { + callback: function( value, index, values ) { + return moment( value ).format( 'L' ); + } + } + } + ], + yAxes: [ + { + ticks: { + callback: function( value, index, values ) { + var convertedValue = mw.language.covertNumber( Number( value ) ); + return convertedValue; + } + } + } + ] + }, + tooltips: { + callbacks: { + title: function( tooltipItems, data ) { + return moment( tooltipItems[ 0 ].xLabel ).format( 'L' ); + }, + label: function( tooltipItem, data ) { + var convertedValue = mw.language.convertNumber( Number( tooltipItem.yLabel ) ); + return convertedValue + ' :' + data.datasets[ tooltipItem.datasetIndex ].label; + } + }, + } + }; }; /** @@ -596,7 +632,7 @@ new Chart( ctx, { type: 'line', data: data, - options: {} + options: this.chartOptions } ); }; @@ -653,7 +689,7 @@ new Chart( ctx, { type: 'line', data: data, - options: {} + options: this.chartOptions } ); }; @@ -691,7 +727,7 @@ new Chart( ctx, { type: 'bar', data: data, - options: {} + options: this.chartOptions } ); }; @@ -739,7 +775,7 @@ new Chart( ctx, { type: 'bar', data: data, - options: {} + options: this.chartOptions } ); }; -- To view, visit https://gerrit.wikimedia.org/r/398174 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24e74564b8ec8bbad7248462aea8f8a9ddd313b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Ryan10145 <chang.ryan10...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits