diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 36 |
1 files changed, 21 insertions, 15 deletions
@@ -20,6 +20,7 @@ #include <stdio.h> #include <stdlib.h> #include "defs.h" +#include "i18n.h" #include "opk.h" #include "ustar.h" @@ -72,9 +73,9 @@ struct option _longopts[] = { static void _help(const char *program_name) { - printf("Usage: %s OPTION... PACKAGE\n", program_name); + printf(_("Usage: %s OPTION... PACKAGE\n"), program_name); #ifdef HAVE_GETOPT_LONG - puts("Options:\n" + puts(_("Options:\n" " -I, --info=CONTROL-FILE Print the named control file. If this option is\n" " given multiple times, the named control files will " "be\n" @@ -90,9 +91,9 @@ _help(const char *program_name) " are not checked against those on the host system,\n" " since they may differ.\n" " -h, --help Show this help information and exit.\n" -" -V, --version Show version information and exit."); +" -V, --version Show version information and exit.")); #else - puts("Options:\n" + puts(_("Options:\n" " -I Print the named control file. If this option is given multiple times, " "the\n" " named control files will be printed in the order they appear in the\n" @@ -105,7 +106,7 @@ _help(const char *program_name) " BusyBox tar's verbose listing. User and group IDs and names are not\n" " checked against those on the host system, since they may differ.\n" " -h Show this help information and exit.\n" -" -V Show version information and exit."); +" -V Show version information and exit.")); #endif } @@ -113,20 +114,24 @@ static void _version(void) { printf("%s %s%s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_VERSION_GIT); - printf("Copyright (C) %s %s\n", "2023", "Patrick McDermott"); - puts("License GPLv3+: GNU GPL version 3 or later " + /* TRANSLATORS: The "%s" conversion specifications are the copyright + * year(s) and copyright holder(s), respectively. */ + printf(_("Copyright (C) %s %s\n"), "2023", "Patrick McDermott"); + puts(_("License GPLv3+: GNU GPL version 3 or later " "<http://gnu.org/licenses/gpl.html>.\n" "This is free software: you are free to change and " "redistribute it.\n" "There is NO WARRANTY, to the extent permitted by " - "law.\n"); - printf("Please report bugs to <%s>.\n", PACKAGE_BUGREPORT); + "law.\n")); + printf(_("Please report bugs to <%s>.\n"), PACKAGE_BUGREPORT); } static void _help_tip(const char *program_name) { - fprintf(stderr, "Try \"%s %s\" for more information\n", program_name, + /* TRANSLATORS: The "%s" conversion specifications are the program name + * and help option, respectively. */ + fprintf(stderr, _("Try \"%s %s\" for more information\n"), program_name, #ifdef HAVE_GETOPT_LONG "--help" #else @@ -179,7 +184,8 @@ main(int argc, char *argv[]) _version(); return EXIT_SUCCESS; default: - fprintf(stderr, "%s: Invalid option: \"%c\"\n", + fprintf(stderr, _("%s: Invalid option: " + "\"%c\"\n"), program_name, optopt); _help_tip(program_name); return EXIT_FAILURE; @@ -189,19 +195,19 @@ main(int argc, char *argv[]) argv += optind; if (argc < 1) { - fprintf(stderr, "%s: Missing package file operand\n", + fprintf(stderr, _("%s: Missing package file operand\n"), program_name); _help_tip(program_name); return EXIT_FAILURE; } else if (argc > 1) { - fprintf(stderr, "%s: Too many package file operands\n", + fprintf(stderr, _("%s: Too many package file operands\n"), program_name); _help_tip(program_name); return EXIT_FAILURE; } if (control_files == NULL && list_members == 0) { - fprintf(stderr, "%s: At least one of -I, -f, or -c must be " - "given\n", program_name); + fprintf(stderr, _("%s: At least one of -I, -f, or -c must be " + "given\n"), program_name); _help_tip(program_name); return EXIT_FAILURE; } |