The branch, master has been updated via 1b8018e4368ff5043548e25f08e915805e280e7d (commit) from cf98ef3863af83a43f7bfd5e8f76b1cfe7eb8867 (commit)
- Log ----------------------------------------------------------------- commit 1b8018e4368ff5043548e25f08e915805e280e7d Author: Michal Čihař michal@cihar.com Date: Thu Aug 25 08:36:05 2011 +0200
Use format string for point number, otherwise the translation is wrong in some languages
-----------------------------------------------------------------------
Summary of changes: gis_data_editor.php | 12 +++++++++--- js/gis_data_editor.js | 14 +++++++------- js/messages.php | 1 + 3 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/gis_data_editor.php b/gis_data_editor.php index ec8ad77..fde183d 100644 --- a/gis_data_editor.php +++ b/gis_data_editor.php @@ -191,7 +191,9 @@ if (isset($_REQUEST['get_gis_editor']) && $_REQUEST['get_gis_editor'] == true) { echo('<input type="hidden" name="gis_data[' . $a . '][' . $type . '][no_of_points]" value="' . $no_of_points . '">');
for ($i = 0; $i < $no_of_points; $i++) { - echo('<br/>'); echo __("Point"); echo($i + 1 . ':'); + echo('<br/>'); + printf(__('Point %d'), $i + 1); + echo ':'; ?> <label for="x"><?php echo __("X"); ?></label> <input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][x]" value="<?php echo(isset($gis_data[$a][$type][$i]['x']) ? htmlspecialchars($gis_data[$a][$type][$i]['x']) : ''); ?>" /> <label for="y"><?php echo __("Y"); ?></label> @@ -237,7 +239,9 @@ if (isset($_REQUEST['get_gis_editor']) && $_REQUEST['get_gis_editor'] == true) { echo('<input type="hidden" name="gis_data[' . $a . '][' . $type . '][' . $i . '][no_of_points]" value="' . $no_of_points . '">');
for ($j = 0; $j < $no_of_points; $j++) { - echo('<br/>'); echo __("Point"); echo($j + 1 . ':'); + echo('<br/>'); + printf(__('Point %d'), $j + 1); + echo ':'; ?> <label for="x"><?php echo __("X"); ?></label> <input type="text" name="gis_data[<?php echo($a); ?>][<?php echo($type); ?>][<?php echo($i); ?>][<?php echo($j); ?>][x]" value="<?php echo(isset($gis_data[$a][$type][$i][$j]['x']) ? htmlspecialchars($gis_data[$a][$type][$i][$j]['x']) : ''); ?>" /> <label for="y"><?php echo __("Y"); ?></label> @@ -287,7 +291,9 @@ if (isset($_REQUEST['get_gis_editor']) && $_REQUEST['get_gis_editor'] == true) { echo('<input type="hidden" name="gis_data[' . $a . '][' . $type . '][' . $k . '][' . $i . '][no_of_points]" value="' . $no_of_points . '">');
for ($j = 0; $j < $no_of_points; $j++) { - echo('<br/>'); echo __("Point"); echo($j + 1 . ':'); + echo('<br/>'); + printf(__('Point %d'), $j + 1); + echo ':'; ?> <label for="x"><?php echo __("X"); ?></label> <input type="text" name="<?php echo("gis_data[" . $a . "][" . $type . "][" . $k . "][" . $i . "][" . $j . "][x]"); ?>" value="<?php echo(isset($gis_data[$a][$type][$k][$i][$j]['x']) ? htmlspecialchars($gis_data[$a][$type][$k][$i][$j]['x']) : ''); ?>" /> <label for="y"><?php echo __("Y"); ?></label> diff --git a/js/gis_data_editor.js b/js/gis_data_editor.js index b2bab89..6fb3d7b 100644 --- a/js/gis_data_editor.js +++ b/js/gis_data_editor.js @@ -41,7 +41,7 @@ function prepareJSVersion() { $button.addClass('addJs').removeClass('add'); var classes = $button.attr('class'); $button - .after('<a class="' + classes + '" name="' + $button.attr('name') + .after('<a class="' + classes + '" name="' + $button.attr('name') + '">+ ' + $button.attr('value') + '</a>') .remove(); }); @@ -55,7 +55,7 @@ function prepareJSVersion() { * @returns the HTML for a data point */ function addDataPoint(pointNumber, prefix) { - return '<br>' + PMA_messages['strPoint'] + (pointNumber + 1) + ':' + return '<br>' + $.sprintf(PMA_messages['strPointN'], (pointNumber + 1)) + ':' + '<label for="x"> ' + PMA_messages['strX'] + ' </label>' + '<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value="">' + '<label for="y"> ' + PMA_messages['strY'] + ' </label>' @@ -79,7 +79,7 @@ function initGISEditorVisualization() {
/** * Opens up the GIS data editor. - * + * * @param value current value of the geometry field * @param field field name * @param type geometry type @@ -142,7 +142,7 @@ $(document).ready(function() {
// Remove the class that is added due to the URL being too long. $('.open_gis_editor a').removeClass('formLinkSubmit'); - + /** * Prepares and insert the GIS data to the input field on clicking 'copy'. */ @@ -247,7 +247,7 @@ $(document).ready(function() { for (i = 0; i < noOfPoints; i++) { html += addDataPoint(i, (prefix + '[' + noOfLines + ']')); } - html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]">+ ' + html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]">+ ' + PMA_messages['strAddPoint'] + '</a><br>';
$a.before(html); @@ -274,9 +274,9 @@ $(document).ready(function() { for (i = 0; i < 4; i++) { html += addDataPoint(i, (prefix + '[' + noOfPolygons + '][0]')); } - html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]">+ ' + html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]">+ ' + PMA_messages['strAddPoint'] + '</a><br>' - + '<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]">+ ' + + '<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]">+ ' + PMA_messages['strAddInnerRing'] + '</a><br><br>';
$a.before(html); diff --git a/js/messages.php b/js/messages.php index 5106283..daed474 100644 --- a/js/messages.php +++ b/js/messages.php @@ -286,6 +286,7 @@ $js_messages['strCopy'] = __('Copy'); $js_messages['strX'] = __('X'); $js_messages['strY'] = __('Y'); $js_messages['strPoint'] = __('Point'); +$js_messages['strPointN'] = __('Point %d'); $js_messages['strLineString'] = __('Linestring'); $js_messages['strPolygon'] = __('Polygon'); $js_messages['strGeometry'] = __('Geometry');
hooks/post-receive