diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-07-26 14:57:04 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-07-26 15:03:15 +0200 |
| commit | 44b6d608b05c53e33a09630420525bd8ff707e5b (patch) | |
| tree | 733d15972fd07bffc1beab8f96a5ae3a27c9a468 /addons/website_links/static/src | |
| parent | 1c4f779c331624958b8f0313760535c64e0ffba8 (diff) | |
[FIX] website_links: missing translations
opw-756108
Diffstat (limited to 'addons/website_links/static/src')
| -rw-r--r-- | addons/website_links/static/src/js/website_links_charts.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js index bd8d2e89064..8a39e531ef9 100644 --- a/addons/website_links/static/src/js/website_links_charts.js +++ b/addons/website_links/static/src/js/website_links_charts.js @@ -3,9 +3,11 @@ odoo.define('website_links.charts', function (require) { var Widget = require('web.Widget'); var base = require('web_editor.base'); +var core = require('web.core'); var website = require('website.website'); var Model = require('web.Model'); +var _t = core._t; var exports = {}; if(!$('.o_website_links_chart').length) { @@ -48,11 +50,11 @@ if(!$('.o_website_links_chart').length) { // Set title var nb_clicks = _.reduce(clicks_array, function(total, val) { return total + val[1] ; }, 0); - $(this.$element + ' .title').html(nb_clicks + ' clicks'); + $(this.$element + ' .title').html(nb_clicks + _t(' clicks')); // Fit data into the NVD3 scheme var chart_data = [{}]; - chart_data[0]['key'] = '# of clicks'; + chart_data[0]['key'] = _t('# of clicks'); chart_data[0]['values'] = clicks_array; nv.addGraph(function() { @@ -94,12 +96,12 @@ if(!$('.o_website_links_chart').length) { // Process country data to fit into the NVD3 scheme var processed_data = []; for(var i = 0 ; i < this.data.length ; i++) { - var country_name = this.data[i]['country_id'] ? this.data[i]['country_id'][1] : 'Undefined'; + var country_name = this.data[i]['country_id'] ? this.data[i]['country_id'][1] : _t('Undefined'); processed_data.push({'label':country_name + ' (' + this.data[i]['country_id_count'] + ')', 'value':this.data[i]['country_id_count']}); } // Set title - $(this.$element + ' .title').html(this.data.length + ' countries'); + $(this.$element + ' .title').html(this.data.length + _t(' countries')); nv.addGraph(function() { var chart = nv.models.pieChart() @@ -205,9 +207,9 @@ if(!$('.o_website_links_chart').length) { }); } else { - $('#all_time_charts').prepend('There is no data to show'); - $('#last_month_charts').prepend('There is no data to show'); - $('#last_week_charts').prepend('There is no data to show'); + $('#all_time_charts').prepend(_t('There is no data to show')); + $('#last_month_charts').prepend(_t('There is no data to show')); + $('#last_week_charts').prepend(_t('There is no data to show')); } }); |
