examples: bistromathic: demonstrate internationalization

Currently it was only using stubs.  Let's actually translate the
strings using gettext.

* examples/c/bistromathic/local.mk: Define LOCALEDIR, BISON_LOCALEDIR
and link with libintl.
* examples/c/bistromathic/parse.y: Use them.
Remove useless includes.
Take ENABLE_NLS into account.
(error_format_string): New.
(yyreport_syntax_error): Rewrite to rely on a format string, which is
more appropriate for internationalization.
* examples/c/bistromathic/Makefile: We no longer use Flex.
We need readline and intl.

* doc/bison.texi: Point to bistromathic for a better option for
internationalization.
* po/POTFILES.in: Add bistromathic.
This commit is contained in:
Akim Demaille
2020-04-19 09:13:47 +02:00
parent 401e7c5c36
commit b42702d738
7 changed files with 122 additions and 41 deletions

View File

@@ -7514,7 +7514,9 @@ values, which is always less than @code{YYNTOKENS}.
The name of the symbol whose kind is @var{symbol}, possibly translated.
@end deftypefun
A custom syntax error function looks as follows.
A custom syntax error function looks as follows. This implementation is
inappropriate for internationalization, see the @file{c/bistromathic}
example for a better altnative.
@example
int
@@ -10601,7 +10603,7 @@ Print the version number of Bison and exit.
Print the name of the directory containing locale-dependent data.
@item --print-datadir
Print the name of the directory containing skeletons and XSLT.
Print the name of the directory containing skeletons, CSS and XSLT.
@item -u
@item --update
@@ -12074,7 +12076,9 @@ values, which is always less than @code{YYNTOKENS}.
The name of the symbol whose kind is @var{symbol}, possibly translated.
@end deftypemethod
A custom syntax error function looks as follows.
A custom syntax error function looks as follows. This implementation is
inappropriate for internationalization, see the @file{c/bistromathic}
example for a better altnative.
@example
void
@@ -13327,6 +13331,10 @@ public void reportSyntaxError(YYParser.Context ctx) @{
System.err.println("");
@}
@end example
@noindent
This implementation is inappropriate for internationalization, see the
@file{c/bistromathic} example for a better altnative.
@end deftypemethod
@node Java Action Features