reports don't work when default_locale != en + some missing translations

This commit is contained in:
Kuba Brecka 2013-03-12 15:38:54 +01:00 committed by Neil Lalonde
parent a5a97f88cd
commit b97a3c8d34
2 changed files with 10 additions and 2 deletions

View file

@ -7,7 +7,7 @@
Handlebars.registerHelper('valueAtDaysAgo', function(property, i) { Handlebars.registerHelper('valueAtDaysAgo', function(property, i) {
var data = Ember.Handlebars.get(this, property); var data = Ember.Handlebars.get(this, property);
if( data ) { if( data ) {
var wantedDate = Date.create(i + ' days ago').format('{yyyy}-{MM}-{dd}'); var wantedDate = Date.create(i + ' days ago', 'en').format('{yyyy}-{MM}-{dd}');
var item = data.find( function(d, i, arr) { return d.x === wantedDate; } ); var item = data.find( function(d, i, arr) { return d.x === wantedDate; } );
if( item ) { if( item ) {
return item.y; return item.y;
@ -26,7 +26,7 @@ Handlebars.registerHelper('valueAtDaysAgo', function(property, i) {
Handlebars.registerHelper('sumLast', function(property, numDays) { Handlebars.registerHelper('sumLast', function(property, numDays) {
var data = Ember.Handlebars.get(this, property); var data = Ember.Handlebars.get(this, property);
if( data ) { if( data ) {
var earliestDate = Date.create(numDays + ' days ago'); var earliestDate = Date.create(numDays + ' days ago', 'en');
var sum = 0; var sum = 0;
data.each(function(d){ data.each(function(d){
if(Date.create(d.x) >= earliestDate) { if(Date.create(d.x) >= earliestDate) {

View file

@ -245,12 +245,20 @@ en:
reports: reports:
visits: visits:
title: "Users Visits" title: "Users Visits"
xaxis: "Day"
yaxis: "Number of visits"
signups: signups:
title: "New Users" title: "New Users"
xaxis: "Day"
yaxis: "Number of new users"
topics: topics:
title: "New Topics" title: "New Topics"
xaxis: "Day"
yaxis: "Number of new topics"
posts: posts:
title: "New Posts" title: "New Posts"
xaxis: "Day"
yaxis: "Number of new posts"
site_settings: site_settings:
default_locale: "The default language of this Discourse instance (ISO 639-1 Code)" default_locale: "The default language of this Discourse instance (ISO 639-1 Code)"