stats: l10n everything and use existing keys as much as possible

This commit is contained in:
plegall
2021-01-06 10:09:10 +01:00
parent 6ed9bbee5e
commit 246f6fdf40
3 changed files with 10 additions and 9 deletions
+5 -1
View File
@@ -381,6 +381,8 @@ if (count(get_last(60, 'year')) > 1 )
);
}
ksort($lang['month']);
$template->assign(array(
'compareYears' => get_month_of_last_years($conf['stat_compare_year_displayed']),
'monthStats' => get_month_stats(),
@@ -388,7 +390,9 @@ $template->assign(array(
'lastDays' => $last_days,
'lastMonths' => $last_months,
'lastYears' => $last_years,
'langCode' => strval($user['language'])
'langCode' => strval($user['language']),
'month_labels' => join('~', $lang['month']),
'ADMIN_PAGE_TITLE' => l10n('History'),
));
$template->assign_var_from_handle('ADMIN_CONTENT', 'stats');
+2 -2
View File
@@ -116,7 +116,7 @@ function changeData(dataType, options = displayOptions) {
yAxes: [{
scaleLabel: {
display: true,
labelString: 'Page visited'
labelString: str_number_page_visited
},
tick: {
min: 0
@@ -142,7 +142,7 @@ function changeData(dataType, options = displayOptions) {
yAxes: [{
scaleLabel: {
display: true,
labelString: 'Page visited'
labelString: str_number_page_visited
}
}]
}
+3 -6
View File
@@ -11,8 +11,9 @@ var str_unit_format = {
"day":"dddd",
"month":"MMM YYYY"
}
var str_avg = "{'Average last 12 months'|@translate}"
var str_months = ["{'January'|@translate}", "{'February'|@translate}", "{'March'|@translate}", "{'April'|@translate}", "{'May'|@translate}", "{'June'|@translate}", "{'July'|@translate}", "{'August'|@translate}", "{'September'|@translate}", "{'Octobember'|@translate}", "{'November'|@translate}", "{'December'|@translate}"];
var str_avg = "{'Average last 12 months'|@translate}";
var str_months_tosplit = "{$month_labels}";
var str_months = str_months_tosplit.split('~');
moment.locale("{$langCode}");
{/footer_script}
@@ -23,10 +24,6 @@ moment.locale("{$langCode}");
{combine_script id='stats' load='footer' path='admin/themes/default/js/stats.js'}
<div class="titrePage">
<h2>{'History'|@translate}</h2>
</div>
<div class="stat-compare-mode">
<label class="switch">
<input type="checkbox" id="toggleCompareMode">