mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
* bootstrap: Get runtime translations into runtime-po.
Create runtime-po files automatically, if possible. * configure.ac: Invoke BISON_I18N, so that we eat our own dog food. * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS does not infringe on the user's name space. (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS. * doc/bison.texinfo (Internationalization): Revamp the English and Texinfo syntax a bit, to try to make it clearer. (Bison Options, Option Cross Key): Mention --print-localedir. * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to YYENABLE_NLS. Quote a bit more. * runtime-po/.cvsignore: New file. * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot. * runtime-po/Rules-quot: Remove; now created by bootstrap. * runtime-po/quot.sed: Likewise. * runtime-po/boldquot.sed: Likewise. * runtime-po/en@quot.header: Likewise. * runtime-po/en@boldquot.header: Likewise. * runtime-po/insert-header.sin: Likewise. * runtime-po/remove-potcdate.sin: Likewise. * runtime-po/Makevars: Likewise. * runtime-po/LINGUAS: Likewise. * runtime-po/de.po: Likewise; we will rely on the translation project to maintain this, so "bootstrap" should get it. * src/getarg.s (PRINT_LOCALEDIR_OPTION): Let the C compiler determine its value. * src/main.c (main): Bind the bison-runtime domain, too. * data/yacc.c: Include <libintl.h> when NLS is enabled. (YYI18N): Renamed from _. Use dgettext when NLS is enabled. * po/POTFILES.in: Remove autogenerated file src/parse-gram.c. * runtime-po: New directory. * runtime-po/Makefile.in.in: New file, copied from po/, with modified $(DOMAIN).pot-update rule, so that old messages are never dropped. * runtime-po/Rules-quot: New file, copied from po/. * runtime-po/quot.sed: Likewise. * runtime-po/boldquot.sed: Likewise. * runtime-po/en@quot.header: Likewise. * runtime-po/en@boldquot.header: Likewise. * runtime-po/insert-header.sin: Likewise. * runtime-po/remove-potcdate.sin: Likewise. * runtime-po/Makevars: New file. * runtime-po/POTFILES.in: New file. * runtime-po/LINGUAS: New file. * runtime-po/bison-runtime.pot: New file. * runtime-po/de.po: New file. * m4/bison.m4: New file. * Makefile.am (SUBDIRS): Add runtime-po. (aclocaldir, aclocal_DATA): New variables. * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in. Define aclocaldir. * src/getargs.c (usage): Document --print-localedir option. (PRINT_LOCALEDIR_OPTION): New enum item. (long_options): Add --print-localedir option. (getargs): Handle --print-localedir option. * doc/bison.texinfo (Bison Parser): Remove paragraph about _(). (Internationalization): New section.
This commit is contained in:
@@ -207,9 +207,10 @@ for the equivalent short option also. Similarly for optional arguments.\n"),
|
||||
|
||||
fputs (_("\
|
||||
Operation modes:\n\
|
||||
-h, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n\
|
||||
-y, --yacc emulate POSIX yacc\n"), stdout);
|
||||
-h, --help display this help and exit\n\
|
||||
-V, --version output version information and exit\n\
|
||||
--print-localedir output directory containing locale-dependent data\n\
|
||||
-y, --yacc emulate POSIX yacc\n"), stdout);
|
||||
putc ('\n', stdout);
|
||||
|
||||
fputs (_("\
|
||||
@@ -289,14 +290,16 @@ const char *short_options = "yvegdhr:ltknVo:b:p:S:T::";
|
||||
/* Values for long options that do not have single-letter equivalents. */
|
||||
enum
|
||||
{
|
||||
LOCATIONS_OPTION = CHAR_MAX + 1
|
||||
LOCATIONS_OPTION = CHAR_MAX + 1,
|
||||
PRINT_LOCALEDIR_OPTION
|
||||
};
|
||||
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
/* Operation modes. */
|
||||
{ "help", no_argument, 0, 'h' },
|
||||
{ "version", no_argument, 0, 'V' },
|
||||
{ "help", no_argument, 0, 'h' },
|
||||
{ "version", no_argument, 0, 'V' },
|
||||
{ "print-localedir", no_argument, 0, PRINT_LOCALEDIR_OPTION },
|
||||
|
||||
/* Parser. */
|
||||
{ "name-prefix", required_argument, 0, 'p' },
|
||||
@@ -364,6 +367,10 @@ getargs (int argc, char *argv[])
|
||||
version ();
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
case PRINT_LOCALEDIR_OPTION:
|
||||
printf ("%s\n", LOCALEDIR);
|
||||
exit (EXIT_SUCCESS);
|
||||
|
||||
case 'g':
|
||||
/* Here, the -g and --graph=FILE options are differentiated. */
|
||||
graph_flag = true;
|
||||
|
||||
@@ -56,8 +56,9 @@ main (int argc, char *argv[])
|
||||
{
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
(void) bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
(void) textdomain (PACKAGE);
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
bindtextdomain ("bison-runtime", LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
uniqstrs_new ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user