[GRASS-SVN] r59713 - in grass/trunk: display/d.rast.num raster/r.out.ppm raster/r.out.ppm3 raster/r.thin

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 13 11:15:26 PDT 2014


Author: marisn
Date: 2014-04-13 11:15:26 -0700 (Sun, 13 Apr 2014)
New Revision: 59713

Modified:
   grass/trunk/display/d.rast.num/main.c
   grass/trunk/raster/r.out.ppm/main.c
   grass/trunk/raster/r.out.ppm3/main.c
   grass/trunk/raster/r.thin/io.c
Log:
Fix wrong message plural form handling introduced in r59255 

Modified: grass/trunk/display/d.rast.num/main.c
===================================================================
--- grass/trunk/display/d.rast.num/main.c	2014-04-13 18:08:19 UTC (rev 59712)
+++ grass/trunk/display/d.rast.num/main.c	2014-04-13 18:15:26 UTC (rev 59713)
@@ -67,6 +67,7 @@
     } flg;
     RASTER_MAP_TYPE map_type, inmap_type;
     double t, b, l, r;
+    char *tmpstr1, *tmpstr2;
 
     /* Initialize the GIS calls */
     G_gisinit(argv[0]);
@@ -172,13 +173,17 @@
     /* number of rows and cols in window */
 
     if ((nrows > 75) || (ncols > 75)) {
+        G_asprintf(&tmpstr1, _n("%d row", "%d rows", nrows), nrows);
+        G_asprintf(&tmpstr1, _n("%d col", "%d cols", ncols), ncols);
         /* GTC %s will be replaced by strings "X rows" and "Y cols" */
         G_warning(_("Current region size: %s X %s\n"
 		    "Your current region setting may be too large. "
 		    "Cells displayed on your graphics window may be too "
 		    "small for cell category number to be visible."),
-		  _n("%d row", "%d rows", nrows), 
-          _n("%d col", "%d cols", ncols));
+		    tmpstr1, tmpstr2);
+        G_free(tmpstr1);
+        G_free(tmpstr2); 
+          
     }
     if ((nrows > 200) || (ncols > 200)) {
 	G_fatal_error(_("Aborting (region larger then 200 rows X 200 cols is not allowed)"));

Modified: grass/trunk/raster/r.out.ppm/main.c
===================================================================
--- grass/trunk/raster/r.out.ppm/main.c	2014-04-13 18:08:19 UTC (rev 59712)
+++ grass/trunk/raster/r.out.ppm/main.c	2014-04-13 18:15:26 UTC (rev 59713)
@@ -45,6 +45,7 @@
     struct Cell_head w;
     FILEDESC cellfile = 0;
     FILE *fp;
+    char *tmpstr1, *tmpstr2;
 
 
     G_gisinit(argv[0]);
@@ -97,8 +98,11 @@
     /*G_get_set_window (&w); *//* 10/99 MN: check for current region */
     G_get_window(&w);
 
-    G_message("%s, %s", _n("row = %d", "rows = %d", w.rows), 
-        _n("col = %d", "cols = %d", w.cols));
+    G_asprintf(&tmpstr1, _n("row = %d", "rows = %d", w.rows), w.rows);
+    G_asprintf(&tmpstr2, _n("column = %d", "columns = %d", w.cols), w.cols);
+    G_message("%s, %s", tmpstr1, tmpstr2);
+    G_free(tmpstr1);
+    G_free(tmpstr2); 
 
     /* open raster map for reading */
     cellfile = Rast_open_old(rast->answer, "");

Modified: grass/trunk/raster/r.out.ppm3/main.c
===================================================================
--- grass/trunk/raster/r.out.ppm3/main.c	2014-04-13 18:08:19 UTC (rev 59712)
+++ grass/trunk/raster/r.out.ppm3/main.c	2014-04-13 18:15:26 UTC (rev 59713)
@@ -49,6 +49,7 @@
     unsigned char *dummy;
     int row, col;
     int i;
+    char *tmpstr1, *tmpstr2;
 
     G_gisinit(argv[0]);
 
@@ -91,8 +92,12 @@
 
     G_get_window(&w);
 
-    G_message("%s, %s", _n("row = %d", "rows = %d", w.rows), 
-        _n("col = %d", "cols = %d", w.cols));
+    G_asprintf(&tmpstr1, _n("row = %d", "rows = %d", w.rows), w.rows);
+    /* GTC Raster columns */
+    G_asprintf(&tmpstr2, _n("column = %d", "columns = %d", w.cols), w.cols);
+    G_message("%s, %s", tmpstr1, tmpstr2);
+    G_free(tmpstr1);
+    G_free(tmpstr2); 
 
     /* open raster map for reading */
     for (i = 0; i < 3; i++) {

Modified: grass/trunk/raster/r.thin/io.c
===================================================================
--- grass/trunk/raster/r.thin/io.c	2014-04-13 18:08:19 UTC (rev 59712)
+++ grass/trunk/raster/r.thin/io.c	2014-04-13 18:15:26 UTC (rev 59713)
@@ -87,6 +87,7 @@
     int cell_file, buf_len;
     int i, row;
     CELL *buf;
+    char *tmpstr1, *tmpstr2;
 
     /* open raster map */
     cell_file = Rast_open_old(name, "");
@@ -98,10 +99,16 @@
 
     n_rows = Rast_window_rows();
     n_cols = Rast_window_cols();
-    /* GTC First is the file name, second and third - number of rows and cols */
-    G_message(_("File %s -- %s X %s"), name, 
-        _n("%d row", "%d rows", n_rows), 
-        _n("%d column", "%d columns", n_cols));
+    
+    /* GTC Count of raster rows */
+    G_asprintf(&tmpstr1, _n("%d row", "%d rows", n_rows), n_rows);
+    /* GTC Count of raster columns */
+    G_asprintf(&tmpstr2, _n("%d column", "%d columns", n_cols), n_cols);
+    /* GTC First argument is the raster map name, second and third - a string representing number of rows and cols */
+    G_message(_("Raster map <%s> - %s X %s"), name, tmpstr1, tmpstr2);
+    G_free(tmpstr1);
+    G_free(tmpstr2);
+    
     n_cols += (PAD << 1);
 
     /* copy raster map into our read/write file */
@@ -156,20 +163,30 @@
     int cell_file, row, k;
     int row_count, col_count;
     CELL *buf;
+    char *tmpstr1, *tmpstr2;
 
     cell_file = Rast_open_c_new(name);
 
     row_count = n_rows - (PAD << 1);
     col_count = n_cols - (PAD << 1);
+    
+    /* GTC Count of raster rows */
+    G_asprintf(&tmpstr1, _n("%d row", "%d rows", row_count), row_count);
+    /* GTC Count of raster columns */
+    G_asprintf(&tmpstr2, _n("%d column", "%d columns", col_count), col_count);
     /* GTC %s will be replaced with number of rows and columns */
-    G_message(_("Output file %s X %s"), 
-        _n("%d row", "%d rows", row_count), 
-        _n("%d column", "%d columns", col_count));
+    G_message(_("Output map %s X %s"), tmpstr1, tmpstr2);
+    G_free(tmpstr1);
+    G_free(tmpstr2); 
     
+    /* GTC Count of window rows */
+    G_asprintf(&tmpstr1, _n("%d row", "%d rows", Rast_window_rows()), Rast_window_rows());
+    /* GTC Count of window columns */
+    G_asprintf(&tmpstr2, _n("%d column", "%d columns", Rast_window_cols()), Rast_window_cols());
     /* GTC %s will be replaced with number of rows and columns */
-    G_message(_("Window %s X %s"), 
-        _n("%d row", "%d rows", Rast_window_rows()), 
-        _n("%d column", "%d columns", Rast_window_cols()));
+    G_message(_("Window %s X %s"), tmpstr1, tmpstr2);
+    G_free(tmpstr1);
+    G_free(tmpstr2); 
 
     for (row = 0, k = PAD; row < row_count; row++, k++) {
 	buf = get_a_row(k);



More information about the grass-commit mailing list