]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl99.c
Fix build with NLS disabled.
[cdecl99.git] / src / cdecl99.c
index 64b95f78cf38a2778dd5a20bad73efc43d45553b..04de1a6640e92225676f3e56872a63e26945a70d 100644 (file)
@@ -21,7 +21,9 @@
 #include <stdbool.h>
 #include <string.h>
 #include <errno.h>
+#include <locale.h>
 #include <getopt.h>
+#include <gettext.h>
 #include "readline.h"
 #include "cdecl.h"
 
@@ -41,7 +43,8 @@ static const struct option lopts[] = {
 static void print_version(void)
 {
        puts(PACKAGE_STRING);
-       puts("Copyright (C) 2011 Nick Bowler.");
+       /* TRANSLATORS: (C) must *always* be translated as ©. */
+       printf("Copyright %s 2011 Nick Bowler.\n", gettext("(C)"));
        puts("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.");
        puts("This is free software: you are free to change and redistribute it.");
        puts("There is NO WARRANTY, to the extent permitted by law.");
@@ -316,6 +319,11 @@ int main(int argc, char **argv)
        if (argc > 0)
                progname = argv[0];
 
+       /* Initialize gettext. */
+       setlocale(LC_ALL, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+
        while ((opt = getopt_long(argc, argv, sopts, lopts, NULL)) != -1) {
                switch (opt) {
                case 'q':