From 678f11313b31b28d12d806032b6359a00d6b89a1 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 6 Feb 2017 18:39:21 +0545 Subject: Internationalization graph.php 1) A few extra strings to be translated. 2) The scale_type code values 'up' and 'follow' need to be kept as those strings in the JS scale_type variable. The text to be translated needs to be in a different variable that can be in translated form for display. Otherwise things go wrong when in a different language. e.g. switch to Brazilian Portuguese, then the Autoscale. The first times it switches then gets "stuck". --- src/usr/local/www/graph.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/usr/local/www/graph.php') diff --git a/src/usr/local/www/graph.php b/src/usr/local/www/graph.php index f5ec63e..1ab5ec7 100644 --- a/src/usr/local/www/graph.php +++ b/src/usr/local/www/graph.php @@ -108,7 +108,7 @@ print('' . "\n");?> > text-anchor="end"> > - > () + > () > > > @@ -178,6 +178,7 @@ var max_num_points = ; // maximum number of plot data points var step = / max_num_points ; var unit = 'bits'; var scale_type = ''; +var scale_type_text = ''; function init(evt) { SVGDoc = evt.target.ownerDocument; @@ -188,13 +189,14 @@ function init(evt) { } function switch_unit(event) { - SVGDoc.getElementById('switch_unit').firstChild.data = ' ' + unit + '/s'; + SVGDoc.getElementById('switch_unit').firstChild.data = (unit == 'bits') ? '' : ''; unit = (unit == 'bits') ? 'bytes' : 'bits'; } function switch_scale(event) { - scale_type = (scale_type == 'up') ? '' : ''; - SVGDoc.getElementById('switch_scale').firstChild.data = 'AutoScale (' + scale_type + ')'; + scale_type = (scale_type == 'up') ? 'follow' : 'up'; + scale_type_text = (scale_type == 'up') ? '' : ''; + SVGDoc.getElementById('switch_scale').firstChild.data = '' + ' (' + scale_type_text + ')'; } function fetch_data() { -- cgit v1.1