Browse Source

Fix wrong message plural form handling introduced in https://trac.osgeo.org/grass/changeset/59255

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59713 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 11 years ago
parent
commit
db45f41ccb
4 changed files with 47 additions and 16 deletions
  1. 7 2
      display/d.rast.num/main.c
  2. 6 2
      raster/r.out.ppm/main.c
  3. 7 2
      raster/r.out.ppm3/main.c
  4. 27 10
      raster/r.thin/io.c

+ 7 - 2
display/d.rast.num/main.c

@@ -67,6 +67,7 @@ int main(int argc, char **argv)
     } flg;
     } flg;
     RASTER_MAP_TYPE map_type, inmap_type;
     RASTER_MAP_TYPE map_type, inmap_type;
     double t, b, l, r;
     double t, b, l, r;
+    char *tmpstr1, *tmpstr2;
 
 
     /* Initialize the GIS calls */
     /* Initialize the GIS calls */
     G_gisinit(argv[0]);
     G_gisinit(argv[0]);
@@ -172,13 +173,17 @@ int main(int argc, char **argv)
     /* number of rows and cols in window */
     /* number of rows and cols in window */
 
 
     if ((nrows > 75) || (ncols > 75)) {
     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" */
         /* GTC %s will be replaced by strings "X rows" and "Y cols" */
         G_warning(_("Current region size: %s X %s\n"
         G_warning(_("Current region size: %s X %s\n"
 		    "Your current region setting may be too large. "
 		    "Your current region setting may be too large. "
 		    "Cells displayed on your graphics window may be too "
 		    "Cells displayed on your graphics window may be too "
 		    "small for cell category number to be visible."),
 		    "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)) {
     if ((nrows > 200) || (ncols > 200)) {
 	G_fatal_error(_("Aborting (region larger then 200 rows X 200 cols is not allowed)"));
 	G_fatal_error(_("Aborting (region larger then 200 rows X 200 cols is not allowed)"));

+ 6 - 2
raster/r.out.ppm/main.c

@@ -45,6 +45,7 @@ int main(int argc, char *argv[])
     struct Cell_head w;
     struct Cell_head w;
     FILEDESC cellfile = 0;
     FILEDESC cellfile = 0;
     FILE *fp;
     FILE *fp;
+    char *tmpstr1, *tmpstr2;
 
 
 
 
     G_gisinit(argv[0]);
     G_gisinit(argv[0]);
@@ -97,8 +98,11 @@ int main(int argc, char *argv[])
     /*G_get_set_window (&w); *//* 10/99 MN: check for current region */
     /*G_get_set_window (&w); *//* 10/99 MN: check for current region */
     G_get_window(&w);
     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 */
     /* open raster map for reading */
     cellfile = Rast_open_old(rast->answer, "");
     cellfile = Rast_open_old(rast->answer, "");

+ 7 - 2
raster/r.out.ppm3/main.c

@@ -49,6 +49,7 @@ int main(int argc, char **argv)
     unsigned char *dummy;
     unsigned char *dummy;
     int row, col;
     int row, col;
     int i;
     int i;
+    char *tmpstr1, *tmpstr2;
 
 
     G_gisinit(argv[0]);
     G_gisinit(argv[0]);
 
 
@@ -91,8 +92,12 @@ int main(int argc, char **argv)
 
 
     G_get_window(&w);
     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 */
     /* open raster map for reading */
     for (i = 0; i < 3; i++) {
     for (i = 0; i < 3; i++) {

+ 27 - 10
raster/r.thin/io.c

@@ -87,6 +87,7 @@ int open_file(char *name)
     int cell_file, buf_len;
     int cell_file, buf_len;
     int i, row;
     int i, row;
     CELL *buf;
     CELL *buf;
+    char *tmpstr1, *tmpstr2;
 
 
     /* open raster map */
     /* open raster map */
     cell_file = Rast_open_old(name, "");
     cell_file = Rast_open_old(name, "");
@@ -98,10 +99,16 @@ int open_file(char *name)
 
 
     n_rows = Rast_window_rows();
     n_rows = Rast_window_rows();
     n_cols = Rast_window_cols();
     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);
     n_cols += (PAD << 1);
 
 
     /* copy raster map into our read/write file */
     /* copy raster map into our read/write file */
@@ -156,20 +163,30 @@ int close_file(char *name)
     int cell_file, row, k;
     int cell_file, row, k;
     int row_count, col_count;
     int row_count, col_count;
     CELL *buf;
     CELL *buf;
+    char *tmpstr1, *tmpstr2;
 
 
     cell_file = Rast_open_c_new(name);
     cell_file = Rast_open_c_new(name);
 
 
     row_count = n_rows - (PAD << 1);
     row_count = n_rows - (PAD << 1);
     col_count = n_cols - (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 */
     /* 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 */
     /* 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++) {
     for (row = 0, k = PAD; row < row_count; row++, k++) {
 	buf = get_a_row(k);
 	buf = get_a_row(k);