[GRASS-SVN] r34654 - in grass/trunk: db/drivers/sqlite
display/d.thematic.area display/d.vect display/d.vect.chart
lib/rst/interp_float lib/sites raster/r.random
vector/lidar/v.surf.bspline vector/v.convert vector/v.in.dwg
vector/v.in.ogr vector/v.info vector/v.net.path
vector/v.surf.rst vector/v.to.points
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Dec 1 11:45:58 EST 2008
Author: martinl
Date: 2008-12-01 11:45:58 -0500 (Mon, 01 Dec 2008)
New Revision: 34654
Modified:
grass/trunk/db/drivers/sqlite/db.c
grass/trunk/display/d.thematic.area/plot1.c
grass/trunk/display/d.vect.chart/plot.c
grass/trunk/display/d.vect/area.c
grass/trunk/display/d.vect/attr.c
grass/trunk/display/d.vect/plot1.c
grass/trunk/lib/rst/interp_float/vinput2d.c
grass/trunk/lib/sites/sites.c
grass/trunk/raster/r.random/random.c
grass/trunk/vector/lidar/v.surf.bspline/crosscorr.c
grass/trunk/vector/v.convert/att.c
grass/trunk/vector/v.in.dwg/main.c
grass/trunk/vector/v.in.ogr/main.c
grass/trunk/vector/v.info/main.c
grass/trunk/vector/v.net.path/path.c
grass/trunk/vector/v.surf.rst/main.c
grass/trunk/vector/v.to.points/main.c
Log:
message standardization, i18n
(merge from devbr6, r34653)
Modified: grass/trunk/db/drivers/sqlite/db.c
===================================================================
--- grass/trunk/db/drivers/sqlite/db.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/db/drivers/sqlite/db.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -1,8 +1,7 @@
-
/**
* \file db.c
*
- * \brief Low Level SQLite databse driver.
+ * \brief DBMI - Low Level SQLite database driver.
*
* This program is free software under the GNU General Public License
* (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -16,19 +15,19 @@
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
+#include <grass/glocale.h>
#include "globals.h"
#include "proto.h"
/**
- * \fn int db__driver_open_database (dbHandle *handle)
- *
* \brief Open SQLite database.
*
* \param[in,out] handle database handle
- * \return int DB_FAILED on error; DB_OK on success
+ *
+ * \return DB_FAILED on error
+ * \return DB_OK on success
*/
-
int db__driver_open_database(dbHandle * handle)
{
char name2[2000];
@@ -82,7 +81,7 @@
G_debug(2, "name2 = '%s'", name2);
if (sqlite3_open(name2, &sqlite) != SQLITE_OK) {
- append_error("Cannot open database: ");
+ append_error(_("Unable to open database: "));
append_error((char *)sqlite3_errmsg(sqlite));
report_error();
return DB_FAILED;
@@ -93,11 +92,9 @@
/**
- * \fn int db__driver_close_database (void)
- *
* \brief Close SQLite database.
*
- * \return int always returns DB_OK
+ * \return always returns DB_OK
*/
int db__driver_close_database(void)
Modified: grass/trunk/display/d.thematic.area/plot1.c
===================================================================
--- grass/trunk/display/d.thematic.area/plot1.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/display/d.thematic.area/plot1.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -102,12 +102,13 @@
if (open_db) {
fi = Vect_get_field(Map, (Clist->field > 0 ? Clist->field : 1));
if (fi == NULL) {
- G_fatal_error(_("Cannot read field info"));
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ (Clist->field > 0 ? Clist->field : 1));
}
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
fi->database, fi->driver);
}
@@ -115,7 +116,7 @@
/* for reading RRR:GGG:BBB color strings from table */
if (rgb_column == NULL || *rgb_column == '\0')
- G_fatal_error(_("Color definition column not specified."));
+ G_fatal_error(_("Color definition column not specified"));
db_CatValArray_init(&cvarr_rgb);
Modified: grass/trunk/display/d.vect/area.c
===================================================================
--- grass/trunk/display/d.vect/area.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/display/d.vect/area.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -51,12 +51,13 @@
fi = Vect_get_field(Map, (Clist->field > 0 ? Clist->field : 1));
if (fi == NULL) {
- G_fatal_error(_("Cannot read field info"));
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ (Clist->field > 0 ? Clist->field : 1));
}
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
fi->database, fi->driver);
}
Modified: grass/trunk/display/d.vect/attr.c
===================================================================
--- grass/trunk/display/d.vect/attr.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/display/d.vect/attr.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -41,7 +41,8 @@
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"), fi->database,
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
+ fi->database,
fi->driver);
Vect_rewind(Map);
@@ -109,7 +110,7 @@
if (db_open_select_cursor
(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
- G_fatal_error(_("Cannot select attributes: %s"),
+ G_fatal_error(_("Unable to open select cursor: '%s'"),
db_get_string(&stmt));
nrows = db_get_num_rows(&cursor);
Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/display/d.vect/plot1.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -103,12 +103,13 @@
if (open_db) {
fi = Vect_get_field(Map, (Clist->field > 0 ? Clist->field : 1));
if (fi == NULL) {
- G_fatal_error(_("Cannot read field info"));
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ (Clist->field > 0 ? Clist->field : 1));
}
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
fi->database, fi->driver);
}
Modified: grass/trunk/display/d.vect.chart/plot.c
===================================================================
--- grass/trunk/display/d.vect.chart/plot.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/display/d.vect.chart/plot.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -4,6 +4,8 @@
#include <grass/display.h>
#include <grass/raster.h>
#include <grass/symbol.h>
+#include <grass/glocale.h>
+
#include "global.h"
/* Returns 0 - ok , 1 - error */
@@ -33,13 +35,14 @@
Fi = Vect_get_field(Map, field);
if (Fi == NULL)
- G_fatal_error("No database table defined for selected field <%d>",
+ G_fatal_error(_("Database connection not defined for layer %d"),
field);
/* Open driver */
driver = db_start_driver_open_database(Fi->driver, Fi->database);
if (driver == NULL) {
- G_warning("Cannot open database %s by driver %s", Fi->database,
+ G_warning(_("Unable to open database <%s> by driver <%s>"),
+ Fi->database,
Fi->driver);
return 1;
}
@@ -79,7 +82,8 @@
if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) !=
DB_OK) {
- G_warning("Cannot open select cursor: %s", buf);
+ G_warning(_("Unable to open select cursor: '%s'"),
+ buf);
return 1;
}
Modified: grass/trunk/lib/rst/interp_float/vinput2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/vinput2d.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/lib/rst/interp_float/vinput2d.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -76,7 +76,8 @@
G_message(_("Loading data from attribute table ..."));
Fi = Vect_get_field(Map, field);
if (Fi == NULL)
- G_fatal_error(_("Cannot get layer info"));
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ field);
G_debug(3, " driver = %s database = %s table = %s", Fi->driver,
Fi->database, Fi->table);
db_init_handle(&handle);
@@ -84,7 +85,8 @@
driver = db_start_driver(Fi->driver);
db_set_handle(&handle, Fi->database, NULL);
if (db_open_database(driver, &handle) != DB_OK)
- G_fatal_error(_("Cannot open database %s"), Fi->database);
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
+ Fi->database, Fi->driver);
zctype = db_column_Ctype(driver, Fi->table, zcol);
G_debug(3, " zcol C type = %d", zctype);
Modified: grass/trunk/lib/sites/sites.c
===================================================================
--- grass/trunk/lib/sites/sites.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/lib/sites/sites.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -317,7 +317,8 @@
driver = db_start_driver_open_database(fi->driver, fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"), fi->database,
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
+ fi->database,
fi->driver);
db_init_string(&stmt);
@@ -325,7 +326,8 @@
db_append_string(&stmt, fi->table);
if (db_open_select_cursor(driver, &stmt, &cursor, DB_SEQUENTIAL) != DB_OK)
- G_fatal_error(_("Cannot select attributes"));
+ G_fatal_error(_("Unable to open select cursor: '%s'"),
+ db_get_string(&stmt));
nrows = db_get_num_rows(&cursor);
G_debug(1, "%d rows selected from vector attribute table", nrows);
Modified: grass/trunk/raster/r.random/random.c
===================================================================
--- grass/trunk/raster/r.random/random.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/raster/r.random/random.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -38,10 +38,11 @@
/* open the data files, input raster should be set-up already */
if ((infd = theState->fd_old) < 0)
- G_fatal_error(_("Cannot open raster map <%s>"), theState->inraster);
+ G_fatal_error(_("Unable to open raster map <%s>"),
+ theState->inraster);
if (theState->docover == 1) {
if ((cinfd = theState->fd_cold) < 0)
- G_fatal_error(_("Cannot open cover raster map <%s>"),
+ G_fatal_error(_("Unable to open raster map <%s>"),
theState->inrcover);
}
@@ -51,7 +52,7 @@
else
type = theState->buf.type;
if ((outfd = G_open_raster_new(theState->outraster, type)) < 0)
- G_fatal_error(_("Cannot create raster map <%s>"),
+ G_fatal_error(_("Unable to create raster map <%s>"),
theState->outraster);
theState->fd_new = outfd;
@@ -70,7 +71,7 @@
db_start_driver_open_database(fi->driver,
Vect_subst_var(fi->database, &Out));
if (!driver)
- G_fatal_error(_("Cannot open database <%s> by driver <%s>"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Vect_subst_var(fi->database, &Out), fi->driver);
Vect_map_add_dblink(&Out, 1, NULL, fi->table, "cat", fi->database,
Modified: grass/trunk/vector/lidar/v.surf.bspline/crosscorr.c
===================================================================
--- grass/trunk/vector/lidar/v.surf.bspline/crosscorr.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/lidar/v.surf.bspline/crosscorr.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -73,7 +73,7 @@
ndata = Vect_get_num_lines(Map);
if (ndata > NDATA_MAX)
- G_warning(_("CrossCorrelation: %d are too many points. "
+ G_warning(_("%d are too many points. "
"The cross validation would take too much time."), ndata);
/*points = Vect_new_line_struct (); */
@@ -82,11 +82,11 @@
/* Current region is read and points recorded into observ */
observ = P_Read_Vector_Region_Map(Map, ®ion, &ndata, 1024, 1);
G_debug(5, "CrossCorrelation: %d points read in region. ", ndata);
- fprintf(stdout, _("CrossCorrelation: %d points read in region.\n"),
- ndata);
+ G_verbose_message(_("%d points read in region"),
+ ndata);
if (ndata > 50)
- G_warning(_("CrossCorrelation: Maybe, it takes too long. "
+ G_warning(_("Maybe, it takes too long. "
"It will depend on how many points you are considering."));
else
G_debug(5, "CrossCorrelation: It shouldn't take too long.");
@@ -110,7 +110,8 @@
Fi = Vect_get_field(Map, bspline_field);
if (Fi == NULL)
- G_fatal_error(_("CrossCorrelation: Cannot read field info"));
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ bspline_field);
driver_cats =
db_start_driver_open_database(Fi->driver, Fi->database);
@@ -118,7 +119,7 @@
Fi->database);
if (driver_cats == NULL)
- G_fatal_error(_("CrossCorrelation: Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Fi->database, Fi->driver);
nrec =
@@ -128,13 +129,14 @@
ctype = cvarr.ctype;
if (ctype != DB_C_TYPE_INT && ctype != DB_C_TYPE_DOUBLE)
- G_fatal_error(_("CrossCorrelation: Column type not supported"));
+ G_fatal_error(_("Column type not supported"));
if (nrec < 0)
- G_fatal_error(_("CrossCorrelation: Cannot select data from table"));
+ G_fatal_error(_("No records selected from table <%s> "),
+ Fi->table);
- G_message(_("CrossCorrelation: %d records selected from table"),
- nrec);
+ G_debug(1, "%d records selected from table",
+ nrec);
db_close_database_shutdown_driver(driver_cats);
}
@@ -145,7 +147,7 @@
nparam_spl = nsplx * nsply; /* Total number of splines */
if (nparam_spl > 22900)
- G_fatal_error(_("CrossCorrelation: Too many splines (%d x %d). "
+ G_fatal_error(_("Too many splines (%d x %d). "
"Consider changing spline steps \"sie=\" \"sin=\"."),
nsplx, nsply);
@@ -163,10 +165,9 @@
for (lbd = 0; lbd < PARAM_LAMBDA; lbd++) { /* For each lambda value */
- fprintf(stdout,
- _("CrossCorrelation: Begining cross validation with "
- "lambda_i=%.4f ...\n"), lambda[lbd]);
-
+ G_message(_("Begining cross validation with "
+ "lambda_i=%.4f..."), lambda[lbd]);
+
/*
How cross correlation algorithm is done:
For each cicle, only the first ndata-1 "observ" elements are considered for the
@@ -214,7 +215,7 @@
obs_mean[i] = dval;
}
if (ret != DB_OK) {
- G_warning(_("CrossCorrelation: No record for point (cat = %d)"),
+ G_warning(_("No record for point (cat = %d)"),
cat);
continue;
}
@@ -284,12 +285,9 @@
stdev[lbd] =
calc_standard_deviation(stat_vect.error, stat_vect.n_points);
- fprintf(stdout, _("CrossCorrelation: Mean = %.5lf\n"), mean[lbd]);
- fprintf(stdout,
- _("CrossCorrelation: Root Means Square (RMS) = %.5lf\n"),
- rms[lbd]);
- fprintf(stdout,
- "\n---------------------o-o-------------------\n\n");
+ G_message(_("Mean = %.5lf"), mean[lbd]);
+ G_message(_("Root Means Square (RMS) = %.5lf"),
+ rms[lbd]);
} /* ENDFOR each lambda value */
G_free_matrix(N);
@@ -304,31 +302,28 @@
stdev_min = find_minimum(stdev, &lbd_min);
/* Writing some output */
- fprintf(stdout,
- _("CrossCorrelation: Different number of splines and lambda_i values have "
- "been taken for the cross correlation\n"));
- fprintf(stdout,
- _("CrossCorrelation: The minimum value for the test (rms=%lf) was obtained with:\n"),
- rms_min);
- fprintf(stdout, _("CrossCorrelation: lambda_i = %.3f\n"),
- lambda[lbd_min]);
+ G_message(_("Different number of splines and lambda_i values have "
+ "been taken for the cross correlation"));
+ G_message(_("The minimum value for the test (rms=%lf) was "
+ "obtained with: lambda_i = %.3f"),
+ rms_min,
+ lambda[lbd_min]);
*lambda_min = lambda[lbd_min];
#endif
- fprintf(stdout, _("Now, the results into a table:\n"));
- fprintf(stdout, _(" lambda | mean | rms |\n"));
+ G_message(_("Results into a table:"));
+ G_message(_(" lambda | mean | rms |"));
for (lbd = 0; lbd < PARAM_LAMBDA; lbd++) {
- fprintf(stdout, _(" %-10.5f| %-12.4f| %-12.4f|\n"), lambda[lbd],
- mean[lbd], rms[lbd]);
+ G_message(_(" %-10.5f| %-12.4f| %-12.4f|"), lambda[lbd],
+ mean[lbd], rms[lbd]);
}
- fprintf(stdout, _("\nResults are over.\n"));
-
+
G_free_vector(mean);
G_free_vector(rms);
} /* ENDIF (ndata > 0) */
else
- G_warning(_("CrossCorrelation: No point lies into the current region"));
+ G_warning(_("No point lies into the current region"));
G_free(observ);
return TRUE;
Modified: grass/trunk/vector/v.convert/att.c
===================================================================
--- grass/trunk/vector/v.convert/att.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.convert/att.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -27,18 +27,18 @@
/* Find vector mapset */
if (NULL == (mapset = G_find_file("dig", in, ""))) {
- G_warning(_("Input vector was not found.")); /* Should not happen */
+ G_warning(_("Vector map <%s> not found"), in); /* Should not happen */
return 0;
}
/* Find dig_cats if exists */
if (NULL == G_find_file("dig_cats", in, mapset)) {
- G_message(_("No category labels (dig_cats) found, no table created.\n"));
+ G_message(_("No category labels (dig_cats) found, no table created"));
return 0;
}
if (G_read_vector_cats(in, mapset, &Cats) == -1) {
- G_warning(_("Cannot open dig_cats file."));
+ G_warning(_("Unable to open dig_cats file"));
return -1;
}
@@ -64,26 +64,31 @@
driver = db_start_driver(fi->driver);
if (driver == NULL)
- G_fatal_error("Cannot open driver %s", fi->driver);
+ G_fatal_error(_("Unable to open driver <%s>"),
+ fi->driver);
db_init_handle(&handle);
db_set_handle(&handle, Vect_subst_var(fi->database, Out), NULL);
if (db_open_database(driver, &handle) != DB_OK) {
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot open database %s"), fi->database);
+ G_fatal_error(_("Unable to open database <%s>"),
+ fi->database);
}
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&sql));
+ G_fatal_error(_("Unable to create table: '%s'"),
+ db_get_string(&sql));
}
if (db_create_index2(driver, fi->table, "cat") != DB_OK)
- G_warning("Cannot create index");
+ G_warning(_("Unable to create index for table <%s>, key <%s>"),
+ fi->table, "cat");
if (db_grant_on_table
(driver, fi->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error("Cannot grant privileges on table %s", fi->table);
+ G_fatal_error(_("Unable to grant privileges on table <%s>"),
+ fi->table);
G_debug(1, "ncats = %d", Cats.ncats);
@@ -102,7 +107,7 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot insert into table: %s"),
+ G_fatal_error(_("Unable to insert new record: '%s'"),
db_get_string(&sql));
}
count++;
Modified: grass/trunk/vector/v.in.dwg/main.c
===================================================================
--- grass/trunk/vector/v.in.dwg/main.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.in.dwg/main.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -6,7 +6,7 @@
*
* PURPOSE: Import of DWG/DXF files
*
- * COPYRIGHT: (C) 2001 by the GRASS Development Team
+ * COPYRIGHT: (C) 2001-2008 by the GRASS Development Team
*
* This program is free software under the
* GNU General Public License (>=v2).
@@ -80,14 +80,10 @@
module = G_define_module();
module->keywords = _("vector, import");
- module->description = "Convert DWG/DXF to GRASS vector map";
+ module->description = _("Converts DWG/DXF to GRASS vector map");
- in_opt = G_define_option();
- in_opt->key = "input";
- in_opt->type = TYPE_STRING;
- in_opt->required = YES;
- in_opt->description = "DWG or DXF file";
- in_opt->gisprompt = "old_file,file,input";
+ in_opt = G_define_standard_option(G_OPT_F_INPUT);
+ in_opt->description = _("Name of DWG or DXF file");
out_opt = G_define_standard_option(G_OPT_V_OUTPUT);
out_opt->required = YES;
@@ -97,28 +93,28 @@
layers_opt->type = TYPE_STRING;
layers_opt->required = NO;
layers_opt->multiple = YES;
- layers_opt->description = "List of layers to import";
+ layers_opt->description = _("List of layers to import");
invert_flag = G_define_flag();
invert_flag->key = 'i';
invert_flag->description =
- "Invert selection by layers (don't import layers in list)";
+ _("Invert selection by layers (don't import layers in list)");
z_flag = G_define_flag();
z_flag->key = 'z';
- z_flag->description = "Create 3D vector";
+ z_flag->description = _("Create 3D vector map");
circle_flag = G_define_flag();
circle_flag->key = 'c';
- circle_flag->description = "Write circles as points (centre)";
+ circle_flag->description = _("Write circles as points (centre)");
l_flag = G_define_flag();
l_flag->key = 'l';
- l_flag->description = "List available layers and exit";
+ l_flag->description = _("List available layers and exit");
int_flag = G_define_flag();
int_flag->key = 'n';
- int_flag->description = "Use numeric type for attribute \"layer\"";
+ int_flag->description = _("Use numeric type for attribute \"layer\"");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -138,10 +134,10 @@
/* Init OpenDWG */
sprintf(path, "%s/etc/adinit.dat", G_gisbase());
if (!adInitAd2(path, &initerror)) {
- sprintf(buf, "Unable to initialize OpenDWG Toolkit, error: %d: %s.",
+ sprintf(buf, _("Unable to initialize OpenDWG Toolkit, error: %d: %s."),
initerror, adErrorStr(initerror));
if (initerror == AD_UNABLE_TO_OPEN_INIT_FILE)
- sprintf(buf, "%s Cannot open %s", buf, path);
+ sprintf(buf, _("%s Cannot open %s"), buf, path);
G_fatal_error(buf);
}
adSetupDwgRead();
@@ -149,7 +145,8 @@
/* Open input file */
if ((dwghandle = adLoadFile(in_opt->answer, AD_PRELOAD_ALL, 1)) == NULL) {
- G_fatal_error("Cannot open input file. Error %d: %s", adError(),
+ G_fatal_error(_("Unable to open input file <%s>. Error %d: %s"),
+ in_opt->answer, adError(),
adErrorStr(adError()));
}
@@ -211,7 +208,7 @@
db_start_driver_open_database(Fi->driver,
Vect_subst_var(Fi->database, &Map));
if (driver == NULL) {
- G_fatal_error("Cannot open database %s by driver %s",
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Vect_subst_var(Fi->database, &Map), Fi->driver);
}
db_begin_transaction(driver);
@@ -236,15 +233,17 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error("Cannot create table: %s", db_get_string(&sql));
+ G_fatal_error(_("Unable to create table: '%s'", db_get_string(&sql));
}
if (db_create_index2(driver, Fi->table, "cat") != DB_OK)
- G_warning("Cannot create index");
+ G_warning(_("Unable to create index for table <%s>, key <%s>"),
+ Fi->table, "cat");
if (db_grant_on_table
(driver, Fi->table, DB_PRIV_SELECT, DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error("Cannot grant privileges on table %s", Fi->table);
+ G_fatal_error(_("Unable to grant privileges on table <%s>"),
+ Fi->table);
cat = 1;
n_elements = n_skipped = 0;
@@ -271,11 +270,6 @@
}
}
- G_message(_("%d elements processed"), n_elements);
- if (n_skipped > 0)
- G_message(_("%d elements skipped (layer name was not in list)"),
- n_skipped);
-
db_commit_transaction(driver);
db_close_database_shutdown_driver(driver);
@@ -284,6 +278,12 @@
Vect_build(&Map, stderr);
Vect_close(&Map);
+
+ if (n_skipped > 0)
+ G_message(_("%d elements skipped (layer name was not in list)"),
+ n_skipped);
+
+ G_done_msg(_("%d elements processed"), n_elements);
exit(EXIT_SUCCESS);
}
Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.in.ogr/main.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -750,24 +750,25 @@
Vect_subst_var(Fi->database,
&Map));
if (driver == NULL) {
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable open database <%s> by driver <%s>"),
Vect_subst_var(Fi->database, &Map), Fi->driver);
}
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database(driver);
db_shutdown_driver(driver);
- G_fatal_error(_("Cannot create table: %s"),
+ G_fatal_error(_("Unable to create table: '%s'"),
db_get_string(&sql));
}
if (db_create_index2(driver, Fi->table, cat_col_name) != DB_OK)
- G_warning(_("Cannot create index"));
+ G_warning(_("Unable to create index for table <%s>, key <%s>"),
+ Fi->table, cat_col_name);
if (db_grant_on_table
(driver, Fi->table, DB_PRIV_SELECT,
DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error(_("Cannot grant privileges on table %s"),
+ G_fatal_error(_("Unable to grant privileges on table <%s>"),
Fi->table);
db_begin_transaction(driver);
Modified: grass/trunk/vector/v.info/main.c
===================================================================
--- grass/trunk/vector/v.info/main.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.info/main.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -62,9 +62,9 @@
G_gisinit(argv[0]);
module = G_define_module();
- module->keywords = _("vector");
+ module->keywords = _("vector, metadata, history");
module->description =
- _("Outputs basic information about a user-specified vector map layer.");
+ _("Outputs basic information about a user-specified vector map.");
/* get G_OPT_ from include/gis.h */
in_opt = G_define_standard_option(G_OPT_V_MAP);
@@ -74,23 +74,28 @@
histf = G_define_flag();
histf->key = 'h';
histf->description = _("Print vector history instead of info");
+ histf->guisection = _("Print");
columns = G_define_flag();
columns->key = 'c';
columns->description =
_("Print types/names of table columns for specified layer instead of info");
+ columns->guisection = _("Print");
gflag = G_define_flag();
gflag->key = 'g';
gflag->description = _("Print map region only");
+ gflag->guisection = _("Print");
mflag = G_define_flag();
mflag->key = 'm';
mflag->description = _("Print map title only");
+ mflag->guisection = _("Print");
tflag = G_define_flag();
tflag->key = 't';
tflag->description = _("Print topology information only");
+ tflag->guisection = _("Print");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -193,18 +198,22 @@
G_message(_("Displaying column types/names for database connection of layer %d:"),
field);
if ((fi = Vect_get_field(&Map, field)) == NULL)
- G_fatal_error("Database connection not defined");
+ G_fatal_error(_("Database connection not defined for layer %d"),
+ field);
driver = db_start_driver(fi->driver);
if (driver == NULL)
- G_fatal_error("Cannot open driver %s", fi->driver);
+ G_fatal_error(_("Unable to open driver <%s>"),
+ fi->driver);
db_init_handle(&handle);
db_set_handle(&handle, fi->database, NULL);
if (db_open_database(driver, &handle) != DB_OK)
- G_fatal_error("Cannot open database <%s>", fi->database);
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
+ fi->database, fi->driver);
db_init_string(&table_name);
db_set_string(&table_name, fi->table);
if (db_describe_table(driver, &table_name, &table) != DB_OK)
- G_fatal_error("Cannot open table <%s>", fi->table);
+ G_fatal_error(_("Unable to describe table <%s>"),
+ fi->table);
ncols = db_get_table_number_of_columns(table);
for (col = 0; col < ncols; col++)
Modified: grass/trunk/vector/v.net.path/path.c
===================================================================
--- grass/trunk/vector/v.net.path/path.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.net.path/path.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -93,7 +93,7 @@
driver = db_start_driver_open_database(Fi->driver, Fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database <%s> by driver <%s>"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Fi->database, Fi->driver);
sprintf(buf,
@@ -106,7 +106,7 @@
if (db_execute_immediate(driver, &sql) != DB_OK) {
db_close_database_shutdown_driver(driver);
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&sql));
+ G_fatal_error(_("Unable to create table: '%s'"), db_get_string(&sql));
}
if (db_create_index2(driver, Fi->table, "cat") != DB_OK)
Modified: grass/trunk/vector/v.surf.rst/main.c
===================================================================
--- grass/trunk/vector/v.surf.rst/main.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.surf.rst/main.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -540,13 +540,14 @@
G_debug(1, db_get_string(&sql2));
driver2 = db_start_driver_open_database(ff->driver, ff->database);
if (driver2 == NULL)
- G_fatal_error(_("Cannot open database %s by driver %s"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
ff->database, ff->driver);
if (db_execute_immediate(driver2, &sql2) != DB_OK) {
db_close_database(driver2);
db_shutdown_driver(driver2);
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&sql2));
+ G_fatal_error(_("Unable to create table: '%s'"),
+ db_get_string(&sql2));
}
count = 1;
Modified: grass/trunk/vector/v.to.points/main.c
===================================================================
--- grass/trunk/vector/v.to.points/main.c 2008-12-01 16:42:44 UTC (rev 34653)
+++ grass/trunk/vector/v.to.points/main.c 2008-12-01 16:45:58 UTC (rev 34654)
@@ -60,7 +60,7 @@
db_append_string(&stmt, buf);
if (db_execute_immediate(driver, &stmt) != DB_OK) {
- G_warning(_("Cannot insert new record: %s"),
+ G_warning(_("Unable to insert new record: '%s'"),
db_get_string(&stmt));
}
}
@@ -265,7 +265,8 @@
&Out), Fi->table);
if (ret == DB_FAILED) {
- G_fatal_error(_("Cannot copy table"));
+ G_fatal_error(_("Unable to copy table <%s>"),
+ Fin->table);
}
}
@@ -276,7 +277,7 @@
/* Open driver */
driver = db_start_driver_open_database(Fi->driver, Fi->database);
if (driver == NULL)
- G_fatal_error(_("Cannot open database <%s> by driver <%s>"),
+ G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Fi->database, Fi->driver);
sprintf(buf,
@@ -286,16 +287,18 @@
if (db_execute_immediate(driver, &stmt) != DB_OK) {
db_close_database_shutdown_driver(driver);
- G_fatal_error(_("Cannot create table: %s"), db_get_string(&stmt));
+ G_fatal_error(_("Unable to create table: '%s'"),
+ db_get_string(&stmt));
}
if (db_create_index2(driver, Fi->table, "cat") != DB_OK)
- G_warning(_("Cannot create index"));
+ G_warning(_("Unable to create index for table <%s>, key <%s>"),
+ Fi->table, "cat");
if (db_grant_on_table
(driver, Fi->table, DB_PRIV_SELECT,
DB_GROUP | DB_PUBLIC) != DB_OK)
- G_fatal_error(_("Cannot grant privileges on table <%s>"),
+ G_fatal_error(_("Unable to grant privileges on table <%s>"),
Fi->table);
db_begin_transaction(driver);
More information about the grass-commit
mailing list