Changeset 29468


Ignore:
Timestamp:
Dec 18, 2007, 3:21:31 AM (17 years ago)
Author:
martinl
Message:

Fixing bug (Trac #1): latitude_of_center and longitude_of_center ignored.
Message standardization, i18n.

Location:
grass/trunk/general/g.setproj
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/general/g.setproj/get_stp.c

    r22410 r29468  
    33#include <stdlib.h>
    44#include <grass/gis.h>
     5#include <grass/glocale.h>
    56#include "local_proto.h"
    67
     
    3637        }
    3738        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"));
    3940
    4041        return;
     
    9293                fipsfile = fopen(FIPSfile, "r");
    9394                if (fipsfile == NULL) {
    94                         G_fatal_error("Can not open FIPS code file");
     95                    G_fatal_error(_("Unable to open FIPS code file"));
    9596                }
    9697                ask_fips(fipsfile, &SFIPS, &CFIPS, &special_case);
     
    117118                        break;
    118119                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);
    121122                }
    122123        }
     
    153154        Tmp_file1 = G_tempfile();
    154155        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);
    156158        Tmp_file2 = G_tempfile();
    157159        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);
    160162        while (fgets(buff, 80, fp) != NULL) {
    161163                sscanf(buff, "%d%d%s%s%d", &sfips, &cfips, STabbr, COname, &NUM_ZON);
     
    171173        sf_keys = G_read_key_value_file(Tmp_file2, &in_stat);
    172174        if (in_stat != 0)
    173                 G_fatal_error("reading sf key_value temp file");
     175            G_fatal_error(_("Reading sf key_value temp file"));
    174176
    175177        for (;;) {
     
    201203                        sprintf(buff, "You have chosen state %s, Correct", a);
    202204                        if (a == NULL)
    203                                 fprintf(stderr, "\nInvalid State FIPS code\n");
     205                            G_warning(_("Invalid State FIPS code"));
    204206                        else if (G_yes(buff, 1))
    205207                                break;
     
    268270        Tmp_file1 = G_tempfile();
    269271        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);
    272274        }
    273275        Tmp_file2 = G_tempfile();
    274276        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);
    277279        }
    278280        while (fgets(buff, 80, fp) != NULL) {
     
    289291        cf_keys = G_read_key_value_file(Tmp_file2, &in_stat);
    290292        if (in_stat != 0)
    291                 G_fatal_error("reading cf key_value temp file");
     293            G_fatal_error(_("Reading cf key_value temp file"));
    292294
    293295        for (;;) {
     
    318320                        sprintf(buff, "You have chosen %s county, correct", b);
    319321                        if (b == NULL)
    320                                 fprintf(stderr, "\nInvalid County FIPS code\n");
     322                            G_warning(_("Invalid County FIPS code"));
    321323                        else if (G_yes(buff, 1))
    322324                                break;
  • grass/trunk/general/g.setproj/main.c

    r25337 r29468  
    7676
    7777    module = G_define_module();
    78     module->keywords = _("general");
     78    module->keywords = _("general, projection");
    7979    module->description =
    8080        _("Interactively reset the location's projection settings.");
     
    9999    stat = G__mapset_permissions(set_name);
    100100    if (stat == 0) {
    101         G_fatal_error(_("PERMANENT: permission denied."));
     101        G_fatal_error(_("PERMANENT: permission denied"));
    102102    }
    103103    G_get_default_window(&cellhd);
    104104    if (-1 == G_set_window(&cellhd))
    105         G_fatal_error(_("Current region cannot be set."));
     105        G_fatal_error(_("Current region cannot be set"));
    106106
    107107    if (G_get_set_window(&cellhd) == -1)
     
    119119        buf = G_find_key_value("name", old_proj_keys);
    120120        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",
    122122                path);
    123123        fprintf(stderr,
     
    131131
    132132        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"));
    134134            leave(SP_NOCHANGE);
    135135        }
     
    143143        if (zone != old_zone) {
    144144            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);
    147147            old_zone = zone;
    148148        }
     
    152152        if (!exist) {
    153153            /* 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"));
    155155            goto write_file;
    156156            break;
     
    205205            G_strip(lbuf);
    206206            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)"),
    208208                        G_datum_name(i), G_datum_description(i));
    209209                if (G_yes(
     
    215215                    sprintf(dat_ellps, G_datum_ellipsoid(i));
    216216                    sph_check = 1;
    217                     G_message(_("The datum information has not been changed."));
     217                    G_message(_("The datum information has not been changed"));
    218218                }
    219219            }
     
    280280                            sph_check = G_ask_ellipse_name(spheroid);
    281281                        else {
    282                             G_message(_("The ellipse information has not been changed."));
     282                            G_message(_("The ellipse information has not been changed"));
    283283                            sph_check = 1;
    284284                        }
     
    428428                        G_message(_("The UTM zone is now set to %d"), old_zone);
    429429                        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"));
    431431                            zone = old_zone;
    432432                            break;
     
    434434                        else {
    435435                            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."));
    439439                            if (!G_yes(_("Would you still like to change the UTM zone?"),
    440440                                 0)) {
     
    455455                /* don't ask, use the default */
    456456
    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) {
    458460                    sprintf(tmp_buff, "%.10f", parm->deflt);
    459461                    G_set_key_value(desc->key, tmp_buff, out_proj_keys);
     
    471473    G_write_key_value_file(path, out_proj_keys, &out_stat);
    472474    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);
    475476    }
    476477
     
    609610        G_write_key_value_file(path, in_unit_keys, &out_stat);
    610611        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);
    612613
    613614        G_free_key_value(in_unit_keys);
     
    615616
    616617    if (G__put_window(&cellhd, "", "DEFAULT_WIND") < 0)
    617         G_fatal_error(_("Could not write to DEFAULT_WIND region file"));
     618        G_fatal_error(_("Unable to write to DEFAULT_WIND region file"));
    618619    fprintf(stderr,
    619620            _("\nProjection information has been recorded for this location\n\n"));
    620621    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"));
    623624    }
    624625    leave(0);
  • grass/trunk/general/g.setproj/proj.c

    r22154 r29468  
    44
    55#include <grass/gis.h>
     6#include <grass/glocale.h>
    67
    78#include "local_proto.h"
     
    173174                {
    174175                        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);
    176177                }
    177178
     
    183184                {
    184185                        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);
    186187                }
    187188        }
Note: See TracChangeset for help on using the changeset viewer.