The "(C)" isn't really a translatable string. Instead of requiring
translations to deal with it, use Gnulib's str_iconv module to encode it
into the user's locale encoding. We fall back to (C) if that fails for
any reason, or if NLS is disabled.
errno_h.m4
extensions.m4
extern-inline.m4
errno_h.m4
extensions.m4
extern-inline.m4
gnulib-comp.m4
gnulib-tool.m4
iconv.m4
gnulib-comp.m4
gnulib-tool.m4
iconv.m4
+iconv_h.m4
+iconv_open.m4
intdiv0.m4
intl.m4
intldir.m4
intdiv0.m4
intl.m4
intldir.m4
lib-link.m4
lib-prefix.m4
libtool.m4
lib-link.m4
lib-prefix.m4
libtool.m4
+libunistring-base.m4
+localcharset.m4
lock.m4
longlong.m4
ltoptions.m4
lock.m4
longlong.m4
ltoptions.m4
realloc.m4
size_max.m4
ssize_t.m4
realloc.m4
size_max.m4
ssize_t.m4
stddef_h.m4
stdint.m4
stdint_h.m4
stddef_h.m4
stdint.m4
stdint_h.m4
# Specification in the form of a command-line invocation:
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk.in --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files getopt-gnu gettext lock readline tls
+# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk.in --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files getopt-gnu gettext localcharset lock readline striconv tls
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
getopt-gnu
gettext
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
getopt-gnu
gettext
msgstr ""
"Project-Id-Version: cdecl99 0.1\n"
"Report-Msgid-Bugs-To: nbowler@draconx.ca\n"
msgstr ""
"Project-Id-Version: cdecl99 0.1\n"
"Report-Msgid-Bugs-To: nbowler@draconx.ca\n"
-"POT-Creation-Date: 2011-10-06 14:48-0400\n"
+"POT-Creation-Date: 2020-06-29 22:52-0400\n"
"PO-Revision-Date: 2011-09-13 21:54-0400\n"
"Last-Translator: Nick Bowler <nbowler@draconx.ca>\n"
"Language-Team: English\n"
"PO-Revision-Date: 2011-09-13 21:54-0400\n"
"Last-Translator: Nick Bowler <nbowler@draconx.ca>\n"
"Language-Team: English\n"
msgid "%s: invalid option -- '%c'\n"
msgstr ""
msgid "%s: invalid option -- '%c'\n"
msgstr ""
-#: lib/getopt.c:858 lib/getopt.c:875 lib/getopt.c:1083 lib/getopt.c:1101
+#: lib/getopt.c:861 lib/getopt.c:878 lib/getopt.c:1088 lib/getopt.c:1106
#, c-format
msgid "%s: option requires an argument -- '%c'\n"
msgstr ""
#, c-format
msgid "%s: option requires an argument -- '%c'\n"
msgstr ""
-#: lib/getopt.c:931 lib/getopt.c:947
+#: lib/getopt.c:934 lib/getopt.c:950
#, c-format
msgid "%s: option '-W %s' is ambiguous\n"
msgstr ""
#, c-format
msgid "%s: option '-W %s' is ambiguous\n"
msgstr ""
-#: lib/getopt.c:971 lib/getopt.c:989
+#: lib/getopt.c:974 lib/getopt.c:992
#, c-format
msgid "%s: option '-W %s' doesn't allow an argument\n"
msgstr ""
#, c-format
msgid "%s: option '-W %s' doesn't allow an argument\n"
msgstr ""
-#: lib/getopt.c:1010 lib/getopt.c:1028
+#: lib/getopt.c:1013 lib/getopt.c:1031
#, c-format
msgid "%s: option '-W %s' requires an argument\n"
msgstr ""
#, c-format
msgid "%s: option '-W %s' requires an argument\n"
msgstr ""
msgctxt "longopt"
msgid "quiet"
msgstr ""
msgctxt "longopt"
msgid "quiet"
msgstr ""
msgctxt "longopt"
msgid "batch"
msgstr ""
msgctxt "longopt"
msgid "batch"
msgstr ""
msgctxt "longopt"
msgid "interactive"
msgstr ""
msgctxt "longopt"
msgid "interactive"
msgstr ""
msgctxt "longopt"
msgid "file"
msgstr ""
msgctxt "longopt"
msgid "file"
msgstr ""
msgctxt "longopt"
msgid "execute"
msgstr ""
msgctxt "longopt"
msgid "execute"
msgstr ""
msgctxt "longopt"
msgid "version"
msgstr ""
msgctxt "longopt"
msgid "version"
msgstr ""
msgctxt "longopt"
msgid "help"
msgstr ""
msgctxt "longopt"
msgid "help"
msgstr ""
+#. TRANSLATORS: Help messages are indented 20 spaces and thus should
+#. not have lines longer than 60 columns.
+#.
+#: src/cdecl99.c:67
msgid "Suppress the welcome message.\n"
msgstr ""
msgid "Suppress the welcome message.\n"
msgstr ""
msgid "Execute commands as normal, but do not print any prompts.\n"
msgstr ""
msgid "Execute commands as normal, but do not print any prompts.\n"
msgstr ""
msgid "Run in interactive mode. This is the default.\n"
msgstr ""
msgid "Run in interactive mode. This is the default.\n"
msgstr ""
msgid "Read commands from FILE instead of standard input.\n"
msgstr ""
msgid "Read commands from FILE instead of standard input.\n"
msgstr ""
msgctxt "longopt|file"
msgid "FILE"
msgstr ""
msgctxt "longopt|file"
msgid "FILE"
msgstr ""
msgid ""
"Execute COMMAND as if it were entered at the prompt.\n"
"This can be specified multiple times.\n"
msgstr ""
msgid ""
"Execute COMMAND as if it were entered at the prompt.\n"
"This can be specified multiple times.\n"
msgstr ""
msgctxt "longopt|execute"
msgid "COMMAND"
msgstr ""
msgctxt "longopt|execute"
msgid "COMMAND"
msgstr ""
msgid "Print a version message and then exit.\n"
msgstr ""
msgid "Print a version message and then exit.\n"
msgstr ""
msgid "Print this message.\n"
msgstr ""
#. TRANSLATORS: ARG is only used for options without help text.
msgid "Print this message.\n"
msgstr ""
#. TRANSLATORS: ARG is only used for options without help text.
msgctxt "longopt"
msgid "ARG"
msgstr ""
msgctxt "longopt"
msgid "ARG"
msgstr ""
-#. TRANSLATORS: (C) must *always* be translated as ©.
-#: src/cdecl99.c:81
-msgid "(C)"
-msgstr "©"
-
-#: src/cdecl99.c:132
#, c-format
msgid " -%c"
msgstr ""
#, c-format
msgid " -%c"
msgstr ""
#, c-format
msgid " -%c, --%s=%s"
msgstr ""
#, c-format
msgid " -%c, --%s=%s"
msgstr ""
#, c-format
msgid " -%c, --%s"
msgstr ""
#, c-format
msgid " -%c, --%s"
msgstr ""
#, c-format
msgid " -%c, --%s=%s, --%s=%s"
msgstr ""
#, c-format
msgid " -%c, --%s=%s, --%s=%s"
msgstr ""
#, c-format
msgid " -%c, --%s, --%s"
msgstr ""
#, c-format
msgid " -%c, --%s, --%s"
msgstr ""
msgid ""
"This is \"cdecl99\": a command-line tool for parsing and constructing\n"
"complicated C declarations.\n"
msgid ""
"This is \"cdecl99\": a command-line tool for parsing and constructing\n"
"complicated C declarations.\n"
"This is “cdecl99”: a command-line tool for parsing and constructing\n"
"complicated C declarations.\n"
"This is “cdecl99”: a command-line tool for parsing and constructing\n"
"complicated C declarations.\n"
msgid "Options:"
msgstr ""
msgid "Options:"
msgstr ""
msgid "For more information, see the cdecl99(1) man page.\n"
msgstr ""
msgid "For more information, see the cdecl99(1) man page.\n"
msgstr ""
+#. TRANSLATORS: Please add *another line* indicating where users should
+#. report translation bugs.
+#.
+#: src/cdecl99.c:214
#, c-format
msgid "Report bugs to <%s>.\n"
msgstr ""
#, c-format
msgid "Report bugs to <%s>.\n"
msgstr ""
/*
* Command line utility for making sense of C declarations.
/*
* Command line utility for making sense of C declarations.
- * Copyright © 2011-2012 Nick Bowler
+ * Copyright © 2011-2012, 2020 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <locale.h>
#include <ctype.h>
#include <errno.h>
#include <locale.h>
-#include <getopt.h>
-#include <gettext.h>
#include "history.h"
#include "cdecl.h"
#include "history.h"
#include "cdecl.h"
+#include <getopt.h>
+#include <gettext.h>
+#include <readline.h>
+#include <striconv.h>
+#include <localcharset.h>
+
#define _(x) gettext(x)
#define N_(x) x
#define PN_(c, x) x
#define _(x) gettext(x)
#define N_(x) x
#define PN_(c, x) x
static void print_version(void)
{
static void print_version(void)
{
+ const char *copysign = "(C)";
+ void *convsign = NULL;
+
+ if (ENABLE_NLS) {
+ convsign = str_iconv("\xc2\xa9", "UTF-8", locale_charset());
+ if (convsign)
+ copysign = convsign;
+ }
+
- /* 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>.");
+ printf("Copyright %s 2020 Nick Bowler.\n", copysign);
+ puts("License GPLv3+: GNU GPL version 3 or any later version.");
puts("This is free software: you are free to change and redistribute it.");
puts("There is NO WARRANTY, to the extent permitted by law.");
puts("This is free software: you are free to change and redistribute it.");
puts("There is NO WARRANTY, to the extent permitted by law.");
}
static void print_usage(FILE *f)
}
static void print_usage(FILE *f)
/* Initialize gettext and setup translated long options. */
static void init_i18n(void)
{
/* Initialize gettext and setup translated long options. */
static void init_i18n(void)
{
+ if (!ENABLE_NLS)
+ return;
+
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- if (!ENABLE_NLS)
- return;
-
for (int i = 0, j = NOPTS; i < NOPTS; i++) {
const char *tname = pgettext_expr("longopt", lopts[i].name);
for (int i = 0, j = NOPTS; i < NOPTS; i++) {
const char *tname = pgettext_expr("longopt", lopts[i].name);