Skip to content

Commit

Permalink
Expose plural forms for translations
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59255 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
marisn committed Mar 15, 2014
1 parent 920231d commit aa59013
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 40 deletions.
17 changes: 12 additions & 5 deletions display/d.linegraph/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,19 @@ int main(int argc, char **argv)
}
}
if ((i > 0) && (in[0].num_pnts != in[i].num_pnts)) {
G_warning(_("Y input file <%s> contains %s data points than the X input file"),
in[i].name,
((in[i].num_pnts < in[0].num_pnts) ? "fewer" : "more"));

if (in[i].num_pnts < in[0].num_pnts) {
G_warning(_("Y input file <%s> contains fewer data points than the X input file"),
in[i].name);
}
else {
G_warning(_("Y input file <%s> contains more data points than the X input file"),
in[i].name);
}

if (in[i].num_pnts > in[0].num_pnts)
G_message(_("The last %d point(s) will be ignored"),
G_message(_n("The last point will be ignored",
"The last %d points will be ignored",
(in[i].num_pnts - in[0].num_pnts)),
(in[i].num_pnts - in[0].num_pnts));
}
}
Expand Down
6 changes: 4 additions & 2 deletions display/d.rast.num/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,13 @@ int main(int argc, char **argv)
/* number of rows and cols in window */

if ((nrows > 75) || (ncols > 75)) {
G_warning(_("Current region size: %d rows X %d cols\n"
/* 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."),
nrows, ncols);
_n("%d row", "%d rows", nrows),
_n("%d col", "%d cols", ncols));
}
if ((nrows > 200) || (ncols > 200)) {
G_fatal_error(_("Aborting (region larger then 200 rows X 200 cols is not allowed)"));
Expand Down
6 changes: 4 additions & 2 deletions display/d.vect/area.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ int display_area(struct Map_info *Map, struct cat_list *Clist, const struct Cell
}

if ((colors || cvarr_rgb) && get_num_color_rules_skipped() > 0)
G_warning(_("%d invalid color rules for areas skipped"),
get_num_color_rules_skipped());
G_warning(_n("%d invalid color rule for areas skipped",
"%d invalid color rules for areas skipped",
get_num_color_rules_skipped()),
get_num_color_rules_skipped());

Vect_destroy_line_struct(Points);
Vect_destroy_line_struct(APoints);
Expand Down
16 changes: 9 additions & 7 deletions display/d.vect/lines.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,21 @@ int display_lines(struct Map_info *Map, int type, struct cat_list *Clist,
}

if ((colors || cvarr_rgb) && get_num_color_rules_skipped() > 0)
G_warning(_("%d invalid color rules for lines skipped"),
get_num_color_rules_skipped());
G_warning(_n("%d invalid color rule for lines skipped",
"%d invalid color rules for lines skipped",
get_num_color_rules_skipped()),
get_num_color_rules_skipped());

if (n_points > 0)
G_verbose_message(_("%d points plotted"), n_points);
G_verbose_message(_n("%d point plotted", "%d points plotted", n_points), n_points);
if (n_lines > 0)
G_verbose_message(_("%d lines plotted"), n_lines);
G_verbose_message(_n("%d line plotted", "%d lines plotted", n_lines), n_lines);
if (n_centroids > 0)
G_verbose_message(_("%d centroids plotted"), n_centroids);
G_verbose_message(_n("%d centroid plotted", "%d centroids plotted", n_centroids), n_centroids);
if (n_boundaries > 0)
G_verbose_message(_("%d boundaries plotted"), n_boundaries);
G_verbose_message(_n("%d boundary plotted", "%d boundaries plotted", n_boundaries), n_boundaries);
if (n_faces > 0)
G_verbose_message(_("%d faces plotted"), n_faces);
G_verbose_message(_n("%d face plotted", "%d faces plotted", n_faces), n_faces);

Vect_destroy_line_struct(Points);
Vect_destroy_cats_struct(Cats);
Expand Down
2 changes: 1 addition & 1 deletion display/d.vect/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ int main(int argc, char **argv)
chcat = 1;
ret = Vect_str_to_cat_list(cat_opt->answer, Clist);
if (ret > 0)
G_warning(_("%d errors in cat option"), ret);
G_warning(_n("%d error in cat option", "%d errors in cat option", ret), ret);
}

type = Vect_option_to_types(type_opt);
Expand Down
2 changes: 1 addition & 1 deletion raster/r.clump/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main(int argc, char *argv[])
Rast_command_history(&hist);
Rast_write_history(OUTPUT, &hist);

G_done_msg(_("%d clumps."), range.max);
G_done_msg(_n("%d clump.", "%d clumps.", range.max), range.max);

exit(EXIT_SUCCESS);
}
7 changes: 5 additions & 2 deletions raster/r.contour/cont.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ void contour(double levels[],

ncrossing = 0;

G_message(_("Writing vector contours (total levels %d)..."), nlevels);
G_message(_n("Writing vector contour (one level)...",
"Writing vector contours (total levels %d)...", nlevels), nlevels);

for (n = 0; n < nlevels; n++) {
level = levels[n];
Expand Down Expand Up @@ -209,7 +210,9 @@ void contour(double levels[],
} /* for levels */

if (ncrossing > 0) {
G_warning(_("%d crossings founds"), ncrossing);
G_warning(_n("%d crossing found",
"%d crossings found",
ncrossing), ncrossing);
}

Vect_destroy_line_struct(Points);
Expand Down
2 changes: 1 addition & 1 deletion raster/r.cost/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ int main(int argc, char *argv[])
if (npoints < 1)
G_fatal_error(_("No start points found in vector map <%s>"), Vect_get_full_name(&In));
else
G_verbose_message(_("%d points found"), npoints);
G_verbose_message(_n("%d point found", "%d points found", npoints), npoints);

Vect_close(&In);
}
Expand Down
3 changes: 2 additions & 1 deletion raster/r.fill.dir/dopolys.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ int dopolys(int fd, int fm, int nl, int ns)
recurse_list(flag, cells, found, i);
}
}
G_message(_("Found %d unresolved areas"), flag);
G_message(_n("Found %d unresolved area",
"Found %d unresolved areas", flag), flag);

/* Compose a new raster map to contain the resulting assignments */
lseek(fm, 0, SEEK_SET);
Expand Down
3 changes: 2 additions & 1 deletion raster/r.out.ppm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ int main(int argc, char *argv[])
/*G_get_set_window (&w); *//* 10/99 MN: check for current region */
G_get_window(&w);

G_message(_("rows = %d, cols = %d"), w.rows, w.cols);
G_message("%s, %s", _n("row = %d", "rows = %d", w.rows),
_n("col = %d", "cols = %d", w.cols));

/* open raster map for reading */
cellfile = Rast_open_old(rast->answer, "");
Expand Down
3 changes: 2 additions & 1 deletion raster/r.out.ppm3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ int main(int argc, char **argv)

G_get_window(&w);

G_message(_("rows = %d, cols = %d"), w.rows, w.cols);
G_message("%s, %s", _n("row = %d", "rows = %d", w.rows),
_n("col = %d", "cols = %d", w.cols));

/* open raster map for reading */
for (i = 0; i < 3; i++) {
Expand Down
3 changes: 2 additions & 1 deletion raster/r.resamp.bspline/crosscorr.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ int cross_correlation(SEGMENT *in_seg, struct Cell_head *src_reg, double passWE,
/* Current region is read and points recorded into observ */
observ = P_Read_Raster_Region_Map(in_seg, &region, src_reg, &ndata, 1024);
G_debug(5, "CrossCorrelation: %d points read in region. ", ndata);
G_verbose_message(_("%d points read in region"),
G_verbose_message(_n("%d point read in region",
"%d points read in region", ndata),
ndata);

if (ndata > 50)
Expand Down
3 changes: 2 additions & 1 deletion raster/r.resamp.rst/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ int main(int argc, char *argv[])
G_message(_("%.2f KB of disk space for temp files."), sdisk / 1024.);
}
else
G_message(_("%d bytes of disk space for temp files."), (int)sdisk);
G_message(_n("%d byte of disk space for temp files.",
"%d bytes of disk space for temp files.", (int)sdisk), (int)sdisk);


fstar2 = fi * fi / 4.;
Expand Down
7 changes: 5 additions & 2 deletions raster/r.stream.extract/del_streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ int del_streams(int min_length)
int other_trib, tmp_trib;
int slength;

G_message(_("Deleting stream segments shorter than %d cells..."), min_length);
G_message(_n("Deleting stream segments shorter than %d cell...",
"Deleting stream segments shorter than %d cells...", min_length),
min_length);

/* TODO: proceed from stream heads to outlets
* -> use depth first post order traversal */
Expand Down Expand Up @@ -188,7 +190,8 @@ int del_streams(int min_length)
}
}

G_verbose_message(_("%d stream segments deleted"), n_deleted);
G_verbose_message(_n("%d stream segment deleted",
"%d stream segments deleted", n_deleted), n_deleted);

return n_deleted;
}
5 changes: 3 additions & 2 deletions raster/r.surf.idw/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ interpolate(MELEMENT rowlist[], SHORT nrows, SHORT ncols, SHORT datarows,
nbr_head->searchptr = &(nbr_head->Mptr); /* see replace_neighbor */
#endif

G_message(_("Interpolating raster map <%s> (%d rows)..."), output,
nrows);
G_message(_n("Interpolating raster map <%s> (%d row)...",
"Interpolating raster map <%s> (%d rows)...", nrows),
output, nrows);

for (row = 0; row < nrows; row++) { /* loop over rows */
G_percent(row+1, nrows, 2);
Expand Down
3 changes: 2 additions & 1 deletion raster/r.surf.idw2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ int main(int argc, char *argv[])

fd = Rast_open_c_new(parm.output->answer);

G_message(_("Interpolating raster map <%s>... %d rows... "),
G_message(_n("Interpolating raster map <%s>... %d row... ",
"Interpolating raster map <%s>... %d rows... ", window.rows),
parm.output->answer, window.rows);

north = window.north - window.ns_res / 2.0;
Expand Down
3 changes: 2 additions & 1 deletion raster/r.texture/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ int main(int argc, char *argv[])
}
}
if (n_measures > 1)
G_message(_("Calculating %d texture measures"), n_measures);
G_message(_n("Calculating %d texture measure",
"Calculating %d texture measures", n_measures), n_measures);
else
G_message(_("Calculating %s"), menu[measure_idx[0]].desc);
alloc_vars(size, dist);
Expand Down
17 changes: 13 additions & 4 deletions raster/r.thin/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ int open_file(char *name)

n_rows = Rast_window_rows();
n_cols = Rast_window_cols();
G_message(_("File %s -- %d rows X %d columns"), name, n_rows, n_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));
n_cols += (PAD << 1);

/* copy raster map into our read/write file */
Expand Down Expand Up @@ -158,9 +161,15 @@ int close_file(char *name)

row_count = n_rows - (PAD << 1);
col_count = n_cols - (PAD << 1);
G_message(_("Output file %d rows X %d columns"), row_count, col_count);
G_message(_("Window %d rows X %d columns"), Rast_window_rows(),
Rast_window_cols());
/* 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));

/* 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()));

for (row = 0, k = PAD; row < row_count; row++, k++) {
buf = get_a_row(k);
Expand Down
2 changes: 1 addition & 1 deletion raster/r.thin/thin_lines.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int thin_lines(int iterations)
} /* end row loop */
} /* j-loop */

G_message(_("Deleted %d pixels "), deleted);
G_message(_n("Deleted %d pixel", "Deleted %d pixels", deleted), deleted);
} /* while delete >0 */

if ((deleted == 0) && (i <= iterations))
Expand Down
4 changes: 3 additions & 1 deletion raster/r.watershed/ram/do_cum.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ int do_cum_mfd(void)
}
}
if (workedon)
G_warning(_("MFD: A * path already processed when distributing flow: %d of %d cells"),
G_warning(_n("MFD: A * path already processed when distributing flow: %d of %d cell",
"MFD: A * path already processed when distributing flow: %d of %d cells",
do_points),
workedon, do_points);


Expand Down
4 changes: 3 additions & 1 deletion raster/r.watershed/seg/init_vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ int init_vars(int argc, char *argv[])
if (seg_flag || bas_flag || haf_flag)
tot_parts++;

G_message(_("SECTION 1 beginning: Initiating Variables. %d sections total."),
G_message(_n("SECTION 1 beginning: Initiating Variables. %d section total.",
"SECTION 1 beginning: Initiating Variables. %d sections total.",
tot_parts),
tot_parts);

this_mapset = G_mapset();
Expand Down
3 changes: 2 additions & 1 deletion raster/simwe/simlib/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ int grad_check(void)

deltap = amin1(deltap, deltaw);

G_message(_("Number of iterations \t= %d cells\n"), miter);
G_message(_n("Number of iterations \t= %d cell\n",
"Number of iterations \t= %d cells\n", miter), miter);
G_message(_("Time step \t= %.2f s\n"), deltap);
if (wdepth) {
G_message(_("Sigmax \t= %f\nMax velocity \t= %f m/s\n"), sigmax,
Expand Down

0 comments on commit aa59013

Please sign in to comment.