Ignore:
Timestamp:
Apr 28, 2006, 12:34:03 AM (18 years ago)
Author:
bcornec
Message:

Integration of a big patch from rene-marc dolhen <rmd_at_mecreant.org> to support internationalization with gettext.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/newt-specific.c

    r296 r497  
    227227                    tmp[i - 1] = '\0';
    228228                }
    229                 if (strstr("yesYES", tmp)) {
     229                if (strstr(_("yesYES"), tmp)) {
    230230                    paranoid_free(tmp);
    231231                    return (TRUE);
    232                 } else if (strstr("NOno", tmp)) {
     232                } else if (strstr(_("NOno"), tmp)) {
    233233                    paranoid_free(tmp);
    234234                    return (FALSE);
     
    236236                    system("sync");
    237237                    printf
    238                         ("Please enter either YES or NO (or yes or no, or y or n, or...)\n");
     238                        (_("Please enter either YES or NO (or yes or no, or y or n, or...)\n"));
    239239                }
    240240            }
    241241        } else {
    242242            paranoid_free(tmp);
    243             return (popup_with_buttons(prompt, "Yes", "No"));
     243            return (popup_with_buttons(prompt, _("Yes"), _("No")));
    244244        }
    245245    }
     
    273273                tmp[i - 1] = '\0';
    274274            }
    275             if (strstr("okOKOkYESyes", tmp)) {
     275            if (strstr(_("okOKOkYESyes"), tmp)) {
    276276                paranoid_free(tmp);
    277277                return (TRUE);
     
    282282        } else {
    283283            paranoid_free(tmp);
    284             return (popup_with_buttons(prompt, " Okay ", "Cancel"));
     284            return (popup_with_buttons(prompt, _(" Okay "), _("Cancel")));
    285285        }
    286286    }
     
    426426            ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null");
    427427        printf
    428                 ("If you require technical support, please contact the mailing list.\n");
    429         printf("See http://www.mondorescue.org for details.\n");
     428                (_("If you require technical support, please contact the mailing list.\n"));
     429        printf(_("See http://www.mondorescue.org for details.\n"));
    430430        printf
    431                 ("The list's members can help you, if you attach that file to your e-mail.\n");
    432         printf("Log file: %s\n", MONDO_LOGFILE);
     431                (_("The list's members can help you, if you attach that file to your e-mail.\n"));
     432        printf(_("Log file: %s\n"), MONDO_LOGFILE);
    433433        if (does_file_exist("/tmp/MA.log.gz")) {
    434434            printf
    435                 ("FYI, I have gzipped the log and saved it to /tmp/MA.log.gz\n");
    436         }
    437         printf("Mondo has aborted.\n");
     435                (_("FYI, I have gzipped the log and saved it to /tmp/MA.log.gz\n"));
     436        }
     437        printf(_("Mondo has aborted.\n"));
    438438        register_pid(0, "mondo");   // finish() does this too, FYI
    439439        if (!g_main_pid) {
     
    490490//  system("clear");
    491491//  iamhere("Finished calling newtFinished");
    492         printf("Execution run ended; result=%d\n", signal);
    493         printf("Type 'less %s' to see the output log\n", MONDO_LOGFILE);
     492        printf(_("Execution run ended; result=%d\n"), signal);
     493        printf(_("Type 'less %s' to see the output log\n"), MONDO_LOGFILE);
    494494        free_libmondo_global_strings();
    495495        exit(signal);
     
    783783            while (((ch = getchar()) != '\n') && (ch != EOF));
    784784        } else {
    785             (void) popup_with_buttons(prompt, " OK ", "");
     785            (void) popup_with_buttons(prompt, _(" OK "), "");
    786786        }
    787787    }
     
    843843#endif
    844844            );
    845         b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, "  OK  ");
    846         b_2 = newtButton(18, newtTextboxGetNumLines(text) + 4, "Cancel");
     845        b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, _("  OK  "));
     846        b_2 = newtButton(18, newtTextboxGetNumLines(text) + 4, _("Cancel"));
    847847        //  newtOpenWindow (8, 5, 54, newtTextboxGetNumLines (text) + 9, title);
    848848        newtCenteredWindow(54, newtTextboxGetNumLines(text) + 9, title);
     
    931931        }
    932932        //  newtOpenWindow (25, 5, 46, newtTextboxGetNumLines (text) + 7, "Alert");
    933         newtCenteredWindow(46, newtTextboxGetNumLines(text) + 7, "Alert");
     933        newtCenteredWindow(46, newtTextboxGetNumLines(text) + 7, _("Alert"));
    934934        myForm = newtForm(NULL, NULL, 0);
    935935        newtFormAddComponents(myForm, text, b_1, b_2, NULL);
     
    997997            newtCls();
    998998            newtPushHelpLine
    999                 ("Welcome to Mondo Rescue, by Hugo Rabson and the Internet. All rights reversed.");
     999                (_("Welcome to Mondo Rescue, by Hugo Rabson and the Internet. All rights reversed."));
    10001000            /*  newtDrawRootText(28,0,"Welcome to Mondo Rescue"); */
    10011001            newtDrawRootText(18, 0, WELCOME_STRING);
     
    10751075            g_isoform_old_progress = percentage;
    10761076            sprintf(timeline_str,
    1077                     "%2ld:%02ld taken            %2ld:%02ld remaining",
     1077                    _("%2ld:%02ld taken            %2ld:%02ld remaining"),
    10781078                    time_taken / 60, time_taken % 60, time_remaining / 60,
    10791079                    time_remaining % 60);
    10801080            if (percentage < 3) {
    1081                 sprintf(pcline_str, " Working");
     1081                sprintf(pcline_str, _(" Working"));
    10821082                for (j = 0; j < g_mysterious_dot_counter; j++) {
    10831083                    strcat(pcline_str, ".");
     
    10891089                        special_dot_char(g_mysterious_dot_counter));
    10901090            } else {
    1091                 sprintf(pcline_str, " %3d%% done              %3d%% to go",
     1091                sprintf(pcline_str, _(" %3d%% done              %3d%% to go"),
    10921092                        percentage, 100 - percentage);
    10931093            }
     
    12351235
    12361236        if (g_text_mode) {
    1237             printf("---progress-form---1--- %s\r\n", blurb1);
    1238             printf("---progress-form---2--- %s\r\n", blurb2);
    1239             printf("---progress-form---3--- %s\r\n", blurb3);
    1240             printf("---progress-form---E---\n");
     1237            printf(_("---progress-form---1--- %s%s"), blurb1, "\r\n");
     1238            printf(_("---progress-form---2--- %s%s"), blurb2, "\r\n");
     1239            printf(_("---progress-form---3--- %s%s"), blurb3, "\r\n");
     1240            printf(_("---progress-form---E---\n"));
    12411241            sprintf(taskprogress, "TASK:  [");
    12421242            for (i = 0; i < percentage; i += 5) {
     
    12471247            }
    12481248            if (percentage > 100) {
    1249                 log_msg(2, "percentage = %d", percentage);
     1249                log_msg(2, _("percentage = %d"), percentage);
    12501250            }
    12511251            sprintf(taskprogress + strlen(taskprogress),
    12521252                    "] %3d%c", percentage, '%');
    12531253            sprintf(taskprogress + strlen(taskprogress),
    1254                     " done; %2ld:%02ld to go",
     1254                    _(" done; %2ld:%02ld to go"),
    12551255                    time_remaining / 60, time_remaining % 60);
    1256             printf("---progress-form---4--- %s\r\n", taskprogress);
     1256            printf(_("---progress-form---4--- %s"), taskprogress, "\r\n");
    12571257        } else {
    12581258            center_string(blurb1, 54);
     
    13301330        if (g_text_mode) {
    13311331            for (backup_type = none; backup_type == none;) {
    1332                 printf("Backup type (");
     1332                printf(_("Backup type ("));
    13331333                for (i = 0; possible_responses[i]; i++) {
    13341334                    printf("%c%s", (i == 0) ? '\0' : ' ',
     
    13521352        if (restoring) {
    13531353            strcpy(title_sz,
    1354                    "Please choose the backup media from which you want to read data.");
    1355             strcpy(minimsg_sz, "Read from:");
     1354                   _("Please choose the backup media from which you want to read data."));
     1355            strcpy(minimsg_sz, _("Read from:"));
    13561356        } else {
    13571357            strcpy(title_sz,
    1358                    "Please choose the backup media to which you want to archive data.");
    1359             strcpy(minimsg_sz, "Backup to:");
     1358                   _("Please choose the backup media to which you want to archive data."));
     1359            strcpy(minimsg_sz, _("Backup to:"));
    13601360        }
    13611361        newtPushHelpLine(title_sz);
    13621362        //  newtOpenWindow (23, 3, 34, 17, minimsg_sz);
    13631363        newtCenteredWindow(34, 17, minimsg_sz);
    1364         b1 = newtButton(1, 1, "CD-R disks ");
    1365         b2 = newtButton(17, 1, "CD-RW disks");
    1366         b3 = newtButton(1, 9, "Tape drive ");
    1367         b4 = newtButton(17, 5, "CD streamer");
    1368         b5 = newtButton(1, 5, " DVD disks ");
    1369         b6 = newtButton(17, 9, " NFS mount ");
    1370         b7 = newtButton(1, 13, " Hard disk ");
    1371         b8 = newtButton(17, 13, "    Exit   ");
     1364        b1 = newtButton(1, 1, _("CD-R disks "));
     1365        b2 = newtButton(17, 1, _("CD-RW disks"));
     1366        b3 = newtButton(1, 9, _("Tape drive "));
     1367        b4 = newtButton(17, 5, _("CD streamer"));
     1368        b5 = newtButton(1, 5, _(" DVD disks "));
     1369        b6 = newtButton(17, 9, _(" NFS mount "));
     1370        b7 = newtButton(1, 13, _(" Hard disk "));
     1371        b8 = newtButton(17, 13, _("    Exit   "));
    13721372        myForm = newtForm(NULL, NULL, 0);
    13731373        newtFormAddComponents(myForm, b1, b5, b3, b7, b2, b4, b6, b8,
     
    14271427        newtDrawRootText(18, 0, WELCOME_STRING);
    14281428        newtPushHelpLine
    1429             ("   Please specify the level of compression that you want.");
     1429            (_("   Please specify the level of compression that you want."));
    14301430        //  newtOpenWindow (23, 3, 34, 13, "How much compression?");
    1431         newtCenteredWindow(34, 13, "How much compression?");
    1432         b1 = newtButton(4, 1, "Maximum");
    1433         b2 = newtButton(18, 1, "Average");
    1434         b3 = newtButton(4, 5, "Minumum");
    1435         b4 = newtButton(18, 5, " None  ");
    1436         b5 = newtButton(4, 9, "         Exit        ");
     1431        newtCenteredWindow(34, 13, _("How much compression?"));
     1432        b1 = newtButton(4, 1, _("Maximum"));
     1433        b2 = newtButton(18, 1, _("Average"));
     1434        b3 = newtButton(4, 5, _("Minimum"));
     1435        b4 = newtButton(18, 5, _(" None  "));
     1436        b5 = newtButton(4, 9, _("         Exit        "));
    14371437        myForm = newtForm(NULL, NULL, 0);
    14381438        newtFormAddComponents(myForm, b1, b3, b2, b4, b5, NULL);
     
    15151515        paranoid_fclose(fin);
    15161516        if (filelist->entries >= ARBITRARY_MAXIMUM) {
    1517             log_to_screen("Arbitrary limits suck, man!");
     1517            log_to_screen(_("Arbitrary limits suck, man!"));
    15181518            paranoid_free(tmp);
    15191519            return (1);
     
    16571657        }
    16581658        sprintf(differ_sz,
    1659                 "  %d files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list.",
     1659                _("  %d files differ. Hit 'Select' to pick a file. Hit 'Close' to quit the list."),
    16601660                i);
    16611661        newtPushHelpLine(differ_sz);
    1662         bClose = newtCompactButton(10, 15, " Close  ");
    1663         bSelect = newtCompactButton(30, 15, " Select ");
    1664         sprintf(tmp, "%-10s               %-20s", "Priority", "Filename");
     1662        bClose = newtCompactButton(10, 15, _(" Close  "));
     1663        bSelect = newtCompactButton(30, 15, _(" Select "));
     1664        sprintf(tmp, "%-10s               %-20s", _("Priority"), _("Filename"));
    16651665        headerMsg = newtLabel(2, 1, tmp);
    1666         newtOpenWindow(5, 4, 70, 16, "Non-matching files");
     1666        newtOpenWindow(5, 4, 70, 16, _("Non-matching files"));
    16671667        myForm = newtForm(NULL, NULL, 0);
    16681668        newtFormAddComponents(myForm, headerMsg, fileListbox, bClose,
     
    16781678                     i++);
    16791679                if (i == filelist->entries && filelist->entries > 0) {
    1680                     log_to_screen("I don't know what that button does!");
     1680                    log_to_screen(_("I don't know what that button does!"));
    16811681                } else {
    16821682                    currline = i;
Note: See TracChangeset for help on using the changeset viewer.