Changeset 29468
- Timestamp:
- Dec 18, 2007, 3:21:31 AM (17 years ago)
- Location:
- grass/trunk/general/g.setproj
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/general/g.setproj/get_stp.c
r22410 r29468 3 3 #include <stdlib.h> 4 4 #include <grass/gis.h> 5 #include <grass/glocale.h> 5 6 #include "local_proto.h" 6 7 … … 36 37 } 37 38 if (get_stp_code(code, string, buff) == 0) 38 G_fatal_error("This should not happen see your system admin");39 G_fatal_error(_("This should not happen see your system admin")); 39 40 40 41 return; … … 92 93 fipsfile = fopen(FIPSfile, "r"); 93 94 if (fipsfile == NULL) { 94 G_fatal_error("Can not open FIPS code file");95 G_fatal_error(_("Unable to open FIPS code file")); 95 96 } 96 97 ask_fips(fipsfile, &SFIPS, &CFIPS, &special_case); … … 117 118 break; 118 119 else { /* no match */ 119 fprintf(stderr, "\nNo match of fips state %d county %d \n", SFIPS, CFIPS);120 fclose(fipsfile);120 G_warning(_("No match of fips state %d county %d"), SFIPS, CFIPS); 121 fclose(fipsfile); 121 122 } 122 123 } … … 153 154 Tmp_file1 = G_tempfile(); 154 155 if (NULL == (Tmp_fd1 = fopen(Tmp_file1, "w"))) 155 G_fatal_error("Cannot open temp file"); 156 G_fatal_error(_("Unable to open temporary file <%s>"), 157 Tmp_file1); 156 158 Tmp_file2 = G_tempfile(); 157 159 if (NULL == (Tmp_fd2 = fopen(Tmp_file2, "w"))) 158 G_fatal_error("Cannot open temp file");159 160 G_fatal_error(_("Unable to open temporary file <%s>"), 161 Tmp_file2); 160 162 while (fgets(buff, 80, fp) != NULL) { 161 163 sscanf(buff, "%d%d%s%s%d", &sfips, &cfips, STabbr, COname, &NUM_ZON); … … 171 173 sf_keys = G_read_key_value_file(Tmp_file2, &in_stat); 172 174 if (in_stat != 0) 173 G_fatal_error("reading sf key_value temp file");175 G_fatal_error(_("Reading sf key_value temp file")); 174 176 175 177 for (;;) { … … 201 203 sprintf(buff, "You have chosen state %s, Correct", a); 202 204 if (a == NULL) 203 fprintf(stderr, "\nInvalid State FIPS code\n");205 G_warning(_("Invalid State FIPS code")); 204 206 else if (G_yes(buff, 1)) 205 207 break; … … 268 270 Tmp_file1 = G_tempfile(); 269 271 if (NULL == (Tmp_fd1 = fopen(Tmp_file1, "w"))) { 270 sprintf(buff, "Cannot open %s", Tmp_file1);271 G_fatal_error(buff);272 G_fatal_error(_("Unable to open temporary file <%s>"), 273 Tmp_file1); 272 274 } 273 275 Tmp_file2 = G_tempfile(); 274 276 if (NULL == (Tmp_fd2 = fopen(Tmp_file2, "w"))) { 275 sprintf(buff, "Cannot open %s", Tmp_file2);276 G_fatal_error(buff);277 G_fatal_error(_("Unable to open temporary file <%s>"), 278 Tmp_file2); 277 279 } 278 280 while (fgets(buff, 80, fp) != NULL) { … … 289 291 cf_keys = G_read_key_value_file(Tmp_file2, &in_stat); 290 292 if (in_stat != 0) 291 G_fatal_error("reading cf key_value temp file");293 G_fatal_error(_("Reading cf key_value temp file")); 292 294 293 295 for (;;) { … … 318 320 sprintf(buff, "You have chosen %s county, correct", b); 319 321 if (b == NULL) 320 fprintf(stderr, "\nInvalid County FIPS code\n");322 G_warning(_("Invalid County FIPS code")); 321 323 else if (G_yes(buff, 1)) 322 324 break; -
grass/trunk/general/g.setproj/main.c
r25337 r29468 76 76 77 77 module = G_define_module(); 78 module->keywords = _("general ");78 module->keywords = _("general, projection"); 79 79 module->description = 80 80 _("Interactively reset the location's projection settings."); … … 99 99 stat = G__mapset_permissions(set_name); 100 100 if (stat == 0) { 101 G_fatal_error(_("PERMANENT: permission denied ."));101 G_fatal_error(_("PERMANENT: permission denied")); 102 102 } 103 103 G_get_default_window(&cellhd); 104 104 if (-1 == G_set_window(&cellhd)) 105 G_fatal_error(_("Current region cannot be set ."));105 G_fatal_error(_("Current region cannot be set")); 106 106 107 107 if (G_get_set_window(&cellhd) == -1) … … 119 119 buf = G_find_key_value("name", old_proj_keys); 120 120 fprintf(stderr, 121 "\nWARNING !A projection file already exists for this location\n(Filename '%s')\n",121 "\nWARNING: A projection file already exists for this location\n(Filename '%s')\n", 122 122 path); 123 123 fprintf(stderr, … … 131 131 132 132 if (!G_yes(_("Would you still like to change some of the parameters?"), 0)) { 133 G_message(_("The projection information will not be updated ."));133 G_message(_("The projection information will not be updated")); 134 134 leave(SP_NOCHANGE); 135 135 } … … 143 143 if (zone != old_zone) { 144 144 G_warning(_("Zone in default geographic region definition: %d\n" 145 " is different from zone in PROJ_INFO file: %d\n"),146 old_zone, zone);145 " is different from zone in PROJ_INFO file: %d"), 146 old_zone, zone); 147 147 old_zone = zone; 148 148 } … … 152 152 if (!exist) { 153 153 /* leap frog over code, and just make sure we remove the file */ 154 fprintf(stderr, "XY-location cannot be projected.\n");154 G_warning (_("XY-location cannot be projected")); 155 155 goto write_file; 156 156 break; … … 205 205 G_strip(lbuf); 206 206 if ((i = G_get_datum_by_name(lbuf)) > 0) { 207 G_message(_("The current datum is %s (%s) ."),207 G_message(_("The current datum is %s (%s)"), 208 208 G_datum_name(i), G_datum_description(i)); 209 209 if (G_yes( … … 215 215 sprintf(dat_ellps, G_datum_ellipsoid(i)); 216 216 sph_check = 1; 217 G_message(_("The datum information has not been changed ."));217 G_message(_("The datum information has not been changed")); 218 218 } 219 219 } … … 280 280 sph_check = G_ask_ellipse_name(spheroid); 281 281 else { 282 G_message(_("The ellipse information has not been changed ."));282 G_message(_("The ellipse information has not been changed")); 283 283 sph_check = 1; 284 284 } … … 428 428 G_message(_("The UTM zone is now set to %d"), old_zone); 429 429 if (!G_yes(_("Do you want to change the UTM zone?"), 0)) { 430 G_message(_("UTM zone information has not been updated ."));430 G_message(_("UTM zone information has not been updated")); 431 431 zone = old_zone; 432 432 break; … … 434 434 else { 435 435 G_message(_("But if you change zone, all the existing " 436 "data will be interpreted by projection software. "437 "GRASS will not automatically re-project or even "438 "change the headers for existing maps."));436 "data will be interpreted by projection software. " 437 "GRASS will not automatically re-project or even " 438 "change the headers for existing maps.")); 439 439 if (!G_yes(_("Would you still like to change the UTM zone?"), 440 440 0)) { … … 455 455 /* don't ask, use the default */ 456 456 457 if (G_strcasecmp(desc->type, "float") == 0) { 457 if (G_strcasecmp(desc->type, "float") == 0 || 458 G_strcasecmp(desc->type, "lat") == 0 || 459 G_strcasecmp(desc->type, "lon") == 0) { 458 460 sprintf(tmp_buff, "%.10f", parm->deflt); 459 461 G_set_key_value(desc->key, tmp_buff, out_proj_keys); … … 471 473 G_write_key_value_file(path, out_proj_keys, &out_stat); 472 474 if (out_stat != 0) { 473 sprintf(buffb, "Error writing PROJ_INFO file: %s\n", path); 474 G_fatal_error(buffb); 475 G_fatal_error(_("Error writing PROJ_INFO file <%s>"), path); 475 476 } 476 477 … … 609 610 G_write_key_value_file(path, in_unit_keys, &out_stat); 610 611 if (out_stat != 0) 611 G_fatal_error(_("Error writing into UNITS output file : %s"), path);612 G_fatal_error(_("Error writing into UNITS output file <%s>"), path); 612 613 613 614 G_free_key_value(in_unit_keys); … … 615 616 616 617 if (G__put_window(&cellhd, "", "DEFAULT_WIND") < 0) 617 G_fatal_error(_(" Could notwrite to DEFAULT_WIND region file"));618 G_fatal_error(_("Unable to write to DEFAULT_WIND region file")); 618 619 fprintf(stderr, 619 620 _("\nProjection information has been recorded for this location\n\n")); 620 621 if ((old_zone != zone) | (old_proj != cellhd.proj)) { 621 G_message(_("The geographic region information in WIND is now obsolete ."));622 G_message(_("Run g.region -d to update it ."));622 G_message(_("The geographic region information in WIND is now obsolete")); 623 G_message(_("Run g.region -d to update it")); 623 624 } 624 625 leave(0); -
grass/trunk/general/g.setproj/proj.c
r22154 r29468 4 4 5 5 #include <grass/gis.h> 6 #include <grass/glocale.h> 6 7 7 8 #include "local_proto.h" … … 173 174 { 174 175 parm->ask = 1; 175 G_warning( "Unrecognized 'ask' value in proj-parms.table: %s", ask);176 G_warning(_("Unrecognized 'ask' value in proj-parms.table: %s"), ask); 176 177 } 177 178 … … 183 184 { 184 185 parm->def_exists = 0; 185 G_warning( "Unrecognized default value in proj-parms.table: %s", dfl);186 G_warning(_("Unrecognized default value in proj-parms.table: %s"), dfl); 186 187 } 187 188 }
Note:
See TracChangeset
for help on using the changeset viewer.
