Changeset 507 in MondoRescue for trunk/mondo/mondo/mondoarchive
- Timestamp:
- Apr 30, 2006, 2:04:16 AM (18 years ago)
- Location:
- trunk/mondo/mondo/mondoarchive
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mondo/mondo/mondoarchive/main.c
r426 r507 138 138 char *say_at_end = NULL; 139 139 140 #ifdef ENABLE_NLS 141 setlocale(LC_ALL, ""); 142 (void) textdomain("mondo"); 143 #endif 140 144 /* Make sure I'm root; abort if not */ 141 145 if (getuid() != 0) { 142 fprintf(stderr, "Please run as root.\r\n");146 fprintf(stderr, _("Please run as root.\n")); 143 147 exit(127); 144 148 } … … 148 152 && (!strcmp(argv[argc - 1], "-v") || !strcmp(argv[argc - 1], "-V") 149 153 || !strcmp(argv[argc - 1], "--version"))) { 150 printf( "mondoarchive v%s\nSee man page for help\n", PACKAGE_VERSION);154 printf(_("mondoarchive v%s\nSee man page for help\n"), PACKAGE_VERSION); 151 155 exit(0); 152 156 } … … 157 161 158 162 diffs = 0; 159 printf( "Initializing...\n");163 printf(_("Initializing...\n")); 160 164 if (!(bkpinfo = malloc(sizeof(struct s_bkpinfo)))) { 161 165 fatal_error("Cannot malloc bkpinfo"); … … 197 201 setup_newt_stuff(); 198 202 if (!strstr(argv[2], "filelist")) { 199 printf( "Sorry - filelist goes first\n");203 printf(_("Sorry - filelist goes first\n")); 200 204 finish(1); 201 205 } else { … … 226 230 setup_newt_stuff(); 227 231 if (!strstr(argv[2], "filelist")) { 228 printf( "Sorry - filelist goes first\n");232 printf(_("Sorry - filelist goes first\n")); 229 233 finish(1); 230 234 } else { … … 245 249 setup_newt_stuff(); 246 250 if ((tmp = find_cdrw_device()) == NULL) { 247 printf( "Failed to find CDR-RW drive\n");248 } else { 249 printf( "CD-RW is at %s\n", tmp);251 printf(_("Failed to find CDR-RW drive\n")); 252 } else { 253 printf(_("CD-RW is at %s\n"), tmp); 250 254 } 251 255 paranoid_free(tmp); 252 256 253 257 if ((tmp = find_cdrom_device(FALSE)) == NULL) { 254 printf( "Failed to find CD-ROM drive\n");255 } else { 256 printf( "CD-ROM is at %s\n", tmp);258 printf(_("Failed to find CD-ROM drive\n")); 259 } else { 260 printf(_("CD-ROM is at %s\n"), tmp); 257 261 } 258 262 paranoid_free(tmp); … … 265 269 setup_newt_stuff(); 266 270 if ((tmp = find_dvd_device()) == NULL) { 267 printf( "Failed to find DVD drive\n");268 } else { 269 printf( "DVD is at %s\n", tmp);271 printf(_("Failed to find DVD drive\n")); 272 } else { 273 printf(_("DVD is at %s\n"), tmp); 270 274 } 271 275 paranoid_free(tmp); … … 279 283 if (argc > 2 && !strcmp(argv[1], "test-dev")) { 280 284 if (is_dev_an_NTFS_dev(argv[2])) { 281 printf( "%s is indeed an NTFS dev\n", argv[2]);282 } else { 283 printf( "%s is _not_ an NTFS dev\n", argv[2]);285 printf(_("%s is indeed an NTFS dev\n"), argv[2]); 286 } else { 287 printf(_("%s is _not_ an NTFS dev\n"), argv[2]); 284 288 } 285 289 finish(0); … … 304 308 if (res) { 305 309 printf 306 ( "Errors were detected in the command line you supplied.\n");307 printf( "Please review the log file - " MONDO_LOGFILE "\n");310 (_("Errors were detected in the command line you supplied.\n")); 311 printf(_("Please review the log file - %s \n"),MONDO_LOGFILE); 308 312 log_msg(1, "Mondoarchive will now exit."); 309 313 finish(1); … … 319 323 320 324 log_to_screen 321 ( "BusyBox's sources are available from http://www.busybox.net");325 (_("BusyBox's sources are available from http://www.busybox.net")); 322 326 323 327 /* If we're meant to backup then backup */ … … 327 331 if (res) { 328 332 asprintf(&say_at_end, 329 "Data archived. Please check the logs, just as a precaution. ");330 } else { 331 asprintf(&say_at_end, "Data archived OK. ");333 _("Data archived. Please check the logs, just as a precaution. ")); 334 } else { 335 asprintf(&say_at_end, _("Data archived OK. ")); 332 336 } 333 337 } … … 337 341 res = verify_data(bkpinfo); 338 342 if (res < 0) { 339 asprintf(&say_at_end, "%d difference%c found.", -res,343 asprintf(&say_at_end, _("%d difference%c found."), -res, 340 344 (-res != 1) ? 's' : ' '); 341 345 res = 0; … … 353 357 if (retval == 0) { 354 358 mvaddstr_and_log_it(g_currentY++, 0, 355 "Backup and/or verify ran to completion. Everything appears to be fine.");359 _("Backup and/or verify ran to completion. Everything appears to be fine.")); 356 360 } else { 357 361 mvaddstr_and_log_it(g_currentY++, 0, 358 "Backup and/or verify ran to completion. However, errors did occur.");362 _("Backup and/or verify ran to completion. However, errors did occur.")); 359 363 } 360 364 361 365 if (does_file_exist("/root/images/mindi/mondorescue.iso")) { 362 366 log_to_screen 363 ( "/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.");367 (_("/root/images/mindi/mondorescue.iso, a boot/utility CD, is available if you want it.")); 364 368 } 365 369 … … 368 372 if (g_text_mode) { 369 373 log_to_screen 370 ( "Type 'less /tmp/changed.files' to see which files don't match the archives");374 (_("Type 'less /tmp/changed.files' to see which files don't match the archives")); 371 375 } else { 372 376 log_msg(1, 373 "Type 'less /tmp/changed.files' to see which files don't match the archives");377 _("Type 'less /tmp/changed.files' to see which files don't match the archives")); 374 378 log_msg(2, "Calling popup_changelist_from_file()"); 375 379 popup_changelist_from_file("/tmp/changed.files"); … … 395 399 system("rm -Rf /tmp.mondo.* /mondo.scratch.*"); 396 400 if (retval == 0) { 397 printf( "Mondoarchive ran OK.\n");401 printf(_("Mondoarchive ran OK.\n")); 398 402 } else { 399 printf( "Errors occurred during backup. Please check logfile.\n");403 printf(_("Errors occurred during backup. Please check logfile.\n")); 400 404 } 401 405 distro_specific_kludges_at_end_of_mondoarchive(); … … 414 418 if (!g_text_mode) { 415 419 popup_and_OK 416 ( "Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.");417 log_to_screen( "See %s for details of backup run.", MONDO_LOGFILE);420 (_("Mondo Archive has finished its run. Please press ENTER to return to the shell prompt.")); 421 log_to_screen(_("See %s for details of backup run."), MONDO_LOGFILE); 418 422 finish(retval); 419 423 } else { 420 printf( "See %s for details of backup run.\n", MONDO_LOGFILE);424 printf(_("See %s for details of backup run.\n"), MONDO_LOGFILE); 421 425 exit(retval); 422 426 } -
trunk/mondo/mondo/mondoarchive/mondo-cli.c
r489 r507 236 236 if (i == 0) { 237 237 retval++; 238 log_to_screen( "You must specify the media type\n");238 log_to_screen(_("You must specify the media type\n")); 239 239 } 240 240 if (i > 1) { 241 241 retval++; 242 log_to_screen( "Please specify only one media type\n");242 log_to_screen(_("Please specify only one media type\n")); 243 243 } 244 244 if (flag_set['K']) { … … 250 250 if (flag_set['L'] && flag_set['0']) { 251 251 retval++; 252 log_to_screen( "You cannot have 'no compression' _and_ LZOP.\n");252 log_to_screen(_("You cannot have 'no compression' _and_ LZOP.\n")); 253 253 } 254 254 bkpinfo->backup_data = flag_set['O']; 255 255 bkpinfo->verify_data = flag_set['V']; 256 256 if (flag_set['I'] && !bkpinfo->backup_data) { 257 log_to_screen( "-I switch is ignored if just verifying");257 log_to_screen(_("-I switch is ignored if just verifying")); 258 258 } 259 259 if (flag_set['E'] && !bkpinfo->backup_data) { 260 log_to_screen( "-E switch is ignored if just verifying");260 log_to_screen(_("-E switch is ignored if just verifying")); 261 261 } 262 262 … … 286 286 if (flag_set['f'] || flag_set['l']) { 287 287 log_to_screen 288 ( "You don't need to specify bootloader or bootdevice");288 (_("You don't need to specify bootloader or bootdevice")); 289 289 } 290 290 } … … 331 331 if (bkpinfo->include_paths[0] == '-') { 332 332 retval++; 333 log_to_screen( "Please supply a sensible value with '-I'\n");333 log_to_screen(_("Please supply a sensible value with '-I'\n")); 334 334 } 335 335 } … … 346 346 retval++; 347 347 log_to_screen 348 ( "Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't muddy the waters by combining -J with -I. Thanks. :-)");348 (_("Please do not use -J in combination with -I. If you want to make a list of files to backup, that's fine, use -J <filename> but please don't combine -J with -I. Thanks. :-)")); 349 349 } 350 350 bkpinfo->make_filelist = FALSE; … … 364 364 if (g_kernel_version >= 2.6 && !strstr(flag_val['d'], "/dev/")) { 365 365 log_to_screen 366 ( "Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk...");366 (_("Linus says 2.6 has a broken ide-scsi module. Proceed at your own risk...")); 367 367 } 368 368 … … 380 380 if (!flag_set['L']) { 381 381 log_to_screen 382 ( "You must use -L with -C. Therefore I am setting it for you.");382 (_("You must use -L with -C. Therefore I am setting it for you.")); 383 383 flag_set['L'] = 1; 384 384 flag_val['L'] = NULL; … … 411 411 412 412 asprintf(&tmp, 413 "You didn't specify a tape streamer device. I'm assuming %s",413 _("You didn't specify a tape streamer device. I'm assuming %s"), 414 414 flag_val['d']); 415 415 log_to_screen(tmp); … … 427 427 if ((flag_val['d'] = find_dvd_device()) != NULL) { 428 428 flag_set['d'] = TRUE; 429 log_to_screen( "I guess DVD drive is at %s", flag_val['d']);429 log_to_screen(_("I guess DVD drive is at %s"), flag_val['d']); 430 430 } 431 431 } … … 445 445 asprintf(&flag_val['s'], "%dm", DEFAULT_DVD_DISK_SIZE); // 4.7 salesman's GB = 4.482 real GB = 4582 MB 446 446 log_to_screen 447 ( "You did not specify a size (-s) for DVD. I'm guessing %s.",447 (_("You did not specify a size (-s) for DVD. I'm guessing %s."), 448 448 flag_val['s']); 449 449 flag_set['s'] = 1; … … 499 499 if (strlen(bkpinfo->isodir) < 3) { 500 500 retval++; 501 log_to_screen( "NFS share is not mounted. Please mount it.\n");501 log_to_screen(_("NFS share is not mounted. Please mount it.\n")); 502 502 } 503 503 log_msg(3, "mount = %s", bkpinfo->nfs_mount); … … 627 627 retval++; 628 628 asprintf(&tmp, 629 "You specified kernel '%s', which does not exist\n",629 _("You specified kernel '%s', which does not exist\n"), 630 630 bkpinfo->kernel_path); 631 631 log_to_screen(tmp); … … 669 669 paranoid_free(tmp); 670 670 asprintf(&tmp, 671 "Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n",671 _("Are you sure directory '%s' exists in remote dir '%s'?\nIf so, do you have rights to write to it?\n"), 672 672 bkpinfo->nfs_remote_dir, bkpinfo->nfs_mount); 673 673 log_to_screen(tmp); … … 680 680 if (g_kernel_version >= 2.6) { 681 681 if (popup_and_get_string 682 ( "Device", "Please specify the device",682 (_("Device"), _("Please specify the device"), 683 683 bkpinfo->media_device, MAX_STR_LEN / 4)) { 684 684 retval++; 685 log_to_screen( "User opted to cancel.");685 log_to_screen(_("User opted to cancel.")); 686 686 } 687 687 } else if ((tmp = find_cdrw_device()) == NULL) { … … 690 690 retval++; 691 691 log_to_screen 692 ( "Tried and failed to find CD-R[W] drive automatically.\n");692 (_("Tried and failed to find CD-R[W] drive automatically.\n")); 693 693 } else { 694 694 flag_set['d'] = TRUE; … … 699 699 if (!flag_set['d'] && !flag_set['n'] && !flag_set['C']) { 700 700 retval++; 701 log_to_screen( "Please specify the backup device/directory.\n");701 log_to_screen(_("Please specify the backup device/directory.\n")); 702 702 fatal_error 703 703 ("You didn't use -d to specify the backup device/directory."); … … 722 722 retval++; 723 723 log_to_screen 724 ( "Please specify a tempdir which I can write to. :)");724 (_("Please specify a tempdir which I can write to. :)")); 725 725 fatal_error("I cannot write to the tempdir you specified."); 726 726 } … … 732 732 retval++; 733 733 log_to_screen 734 ( "Please don't specify a SAMBA or VFAT or NFS tmpdir.");734 (_("Please don't specify a SAMBA or VFAT or NFS tmpdir.")); 735 735 fatal_error("I cannot write to the tempdir you specified."); 736 736 } … … 782 782 i = which_boot_loader(tmp); 783 783 log_msg(3, "boot loader is %c, residing at %s", i, tmp); 784 printf( "boot loader is %c, residing at %s\n", i, tmp);784 printf(_("boot loader is %c, residing at %s\n"), i, tmp); 785 785 finish(0); 786 786 } … … 796 796 retval++; 797 797 log_to_screen 798 ( "Please install LZOP. You can't use '-L' until you do.\n");798 (_("Please install LZOP. You can't use '-L' until you do.\n")); 799 799 } 800 800 } … … 806 806 bkpinfo->make_cd_use_lilo = TRUE; 807 807 log_to_screen 808 ( "Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary.");808 (_("Forcing you to use LILO. SuSE 9.0 (64-bit) has a broken mkfs.vfat binary.")); 809 809 } 810 810 if (flag_set['o']) { … … 816 816 bkpinfo->make_cd_use_lilo = TRUE; 817 817 log_to_screen 818 ( "Your kernel appears not to support vfat filesystems. I am therefore");819 log_to_screen 820 ( "using LILO instead of SYSLINUX as the CD/floppy's boot loader.");818 (_("Your kernel appears not to support vfat filesystems. I am therefore")); 819 log_to_screen 820 (_("using LILO instead of SYSLINUX as the CD/floppy's boot loader.")); 821 821 } 822 822 if (run_program_and_log_output("which mkfs.vfat", FALSE)) { … … 824 824 #ifdef __IA32__ 825 825 log_to_screen 826 ( "Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as");827 log_to_screen 828 ( "your boot loader. I shall therefore use LILO instead.");826 (_("Your filesystem is missing 'mkfs.vfat', so I cannot use SYSLINUX as")); 827 log_to_screen 828 (_("your boot loader. I shall therefore use LILO instead.")); 829 829 #endif 830 830 #ifdef __IA64__ 831 831 log_to_screen 832 ( "Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI");833 log_to_screen( "environment correctly. Please install it.");832 (_("Your filesystem is missing 'mkfs.vfat', so I cannot prepare the EFI")); 833 log_to_screen(_("environment correctly. Please install it.")); 834 834 fatal_error("Aborting"); 835 835 #endif … … 849 849 if (i == 0) { 850 850 retval++; 851 log_to_screen( "Specify backup (-O), verify (-V) or both (-OV).\n");851 log_to_screen(_("Specify backup (-O), verify (-V) or both (-OV).\n")); 852 852 } 853 853 … … 901 901 if (flag_set[optopt]) { 902 902 bad_switches = TRUE; 903 asprintf(&tmp, "Switch -%c previously defined as %s\n", opt,903 asprintf(&tmp, _("Switch -%c previously defined as %s\n"), opt, 904 904 flag_val[i]); 905 905 log_to_screen(tmp); … … 912 912 optarg[--len] = '\0'; 913 913 log_to_screen 914 ( "Warning - param '%s' should not have trailing slash!",914 (_("Warning - param '%s' should not have trailing slash!"), 915 915 optarg); 916 916 } … … 919 919 && flag_val[opt][0] != '/') { 920 920 asprintf(&tmp, 921 "-%c flag --- must be absolute path --- '%s' isn't absolute",921 _("-%c flag --- must be absolute path --- '%s' isn't absolute"), 922 922 opt, flag_val[opt]); 923 923 log_to_screen(tmp); … … 933 933 for (i = optind; i < argc; i++) { 934 934 bad_switches = TRUE; 935 asprintf(&tmp, "Invalid arg -- %s\n", argv[i]);935 asprintf(&tmp, _("Invalid arg -- %s\n"), argv[i]); 936 936 log_to_screen(tmp); 937 937 paranoid_free(tmp); … … 964 964 switch (sig) { 965 965 case SIGINT: 966 asprintf(&tmp, "SIGINT signal received from OS");967 asprintf(&tmp2, "You interrupted me :-)");966 asprintf(&tmp, _("SIGINT signal received from OS")); 967 asprintf(&tmp2, _("You interrupted me :-)")); 968 968 break; 969 969 case SIGKILL: 970 asprintf(&tmp, "SIGKILL signal received from OS");970 asprintf(&tmp, _("SIGKILL signal received from OS")); 971 971 asprintf(&tmp2, 972 "I seriously have no clue how this signal even got to me. Something's wrong with your system.");972 _("I seriously have no clue how this signal even got to me. Something's wrong with your system.")); 973 973 break; 974 974 case SIGTERM: 975 asprintf(&tmp, "SIGTERM signal received from OS");976 asprintf(&tmp2, "Got terminate signal");975 asprintf(&tmp, _("SIGTERM signal received from OS")); 976 asprintf(&tmp2, _("Got terminate signal")); 977 977 break; 978 978 case SIGHUP: 979 asprintf(&tmp, "SIGHUP signal received from OS");980 asprintf(&tmp2, "Hangup on line");979 asprintf(&tmp, _("SIGHUP signal received from OS")); 980 asprintf(&tmp2, _("Hangup on line")); 981 981 break; 982 982 case SIGSEGV: 983 asprintf(&tmp, "SIGSEGV signal received from OS");983 asprintf(&tmp, _("SIGSEGV signal received from OS")); 984 984 asprintf(&tmp2, 985 "Internal programming error. Please send a backtrace as well as your log.");985 _("Internal programming error. Please send a backtrace as well as your log.")); 986 986 break; 987 987 case SIGPIPE: 988 asprintf(&tmp, "SIGPIPE signal received from OS");989 asprintf(&tmp2, "Pipe was broken");988 asprintf(&tmp, _("SIGPIPE signal received from OS")); 989 asprintf(&tmp2, _("Pipe was broken")); 990 990 break; 991 991 case SIGABRT: 992 asprintf(&tmp, "SIGABRT signal received from OS");992 asprintf(&tmp, _("SIGABRT signal received from OS")); 993 993 asprintf(&tmp2, 994 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.");994 _("Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message.")); 995 995 break; 996 996 default: 997 asprintf(&tmp, "(Unknown)");998 asprintf(&tmp2, "(Unknown)");997 asprintf(&tmp, _("(Unknown)")); 998 asprintf(&tmp2, _("(Unknown)")); 999 999 } 1000 1000
Note:
See TracChangeset
for help on using the changeset viewer.