summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2019-01-19 11:08:31 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2019-01-19 11:08:31 +0000
commit214d8aef6ae20e2e318d50f0b824b09dd618c74c (patch)
treecb9a0af4035d6162df3517a11014af7de09757a4
parent328b3d38eaf775388d6aad739f6e091e20350be1 (diff)
Extended description for NLS activation.
Note to maintainers about how to compile the CWEB sources and configure NLS catalogs in the TDS along personal experiments. git-svn-id: svn://tug.org/texlive/trunk@49756 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/cwebboot.cin57
-rw-r--r--Build/source/texk/web2c/cwebdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch79
3 files changed, 80 insertions, 60 deletions
diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin
index e0487f3254b..2ab2b229837 100644
--- a/Build/source/texk/web2c/cwebboot.cin
+++ b/Build/source/texk/web2c/cwebboot.cin
@@ -48,7 +48,7 @@
#endif
/*:88*//*90:*/
-#line 1276 "cwebdir/comm-w2c.ch"
+#line 1301 "cwebdir/comm-w2c.ch"
typedef bool boolean;
#define HAVE_BOOLEAN
@@ -59,9 +59,6 @@ typedef bool boolean;
#define CWEB
#include "help.h"
-
-
-
/*:90*/
#line 59 "cwebdir/common.w"
@@ -186,9 +183,6 @@ err_print(_("! Include file name too long") ) ;goto restart;} \
#define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true) \
-#define show_kpathsea_debug flags['d'] \
- \
-
#line 60 "cwebdir/common.w"
@@ -430,14 +424,14 @@ static void extend_section_name(name_pointer,char*,char*,int);
static void check_change(void);
static void prime_the_change_buffer(void);
-/*:84*//*95:*/
-#line 1332 "cwebdir/comm-w2c.ch"
+/*:84*//*98:*/
+#line 1402 "cwebdir/comm-w2c.ch"
-void cb_show_banner(void);
static void cb_usage(const_string str);
static void cb_usagehelp(const_string*message,const_string bug_email);
+void cb_show_banner(void);
-/*:95*/
+/*:98*/
#line 63 "cwebdir/common.w"
@@ -471,7 +465,7 @@ root= NULL;
#line 72 "cwebdir/comm-w2c.ch"
/*91:*/
-#line 1297 "cwebdir/comm-w2c.ch"
+#line 1316 "cwebdir/comm-w2c.ch"
kpse_set_program_name(argv[0],"cweb");
@@ -479,7 +473,7 @@ kpse_set_program_name(argv[0],"cweb");
#line 73 "cwebdir/comm-w2c.ch"
/*89:*/
-#line 1244 "cwebdir/comm-w2c.ch"
+#line 1269 "cwebdir/comm-w2c.ch"
setlocale(LC_MESSAGES,setlocale(LC_CTYPE,""));
texmf_locale= kpse_var_expand(TEXMF_LOCALE);
@@ -1435,7 +1429,7 @@ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*74:*/
if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
/*94:*/
-#line 1325 "cwebdir/comm-w2c.ch"
+#line 1341 "cwebdir/comm-w2c.ch"
cb_usagehelp(program==ctangle?CTANGLEHELP:
program==cweave?CWEAVEHELP:CTWILLHELP,NULL);
@@ -1446,15 +1440,15 @@ program==cweave?CWEAVEHELP:CTWILLHELP,NULL);
if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
-/*97:*/
-#line 1382 "cwebdir/comm-w2c.ch"
+/*96:*/
+#line 1383 "cwebdir/comm-w2c.ch"
printversionandexit(cb_banner,
program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth",
NULL,NULL);
-/*:97*/
+/*:96*/
#line 1000 "cwebdir/comm-w2c.ch"
if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0)
@@ -1636,18 +1630,8 @@ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill");
}
#line 953 "cwebdir/comm-w2c.ch"
-/*:70*//*96:*/
-#line 1339 "cwebdir/comm-w2c.ch"
-
-void cb_show_banner(void)
-{
-assert(cb_banner[0]!='\0');
-textdomain("cweb-tl");
-
-printf("%s%s\n",_(cb_banner),versionstring);
-textdomain("cweb");
-
-}
+/*:70*//*95:*/
+#line 1349 "cwebdir/comm-w2c.ch"
static void cb_usage(const_string str)
{
@@ -1679,4 +1663,17 @@ textdomain("cweb");
history= spotless;exit(wrap_up());
}
-/*:96*/
+/*:95*//*97:*/
+#line 1391 "cwebdir/comm-w2c.ch"
+
+void cb_show_banner(void)
+{
+assert(cb_banner[0]!='\0');
+textdomain("cweb-tl");
+
+printf("%s%s\n",_(cb_banner),versionstring);
+textdomain("cweb");
+
+}
+
+/*:97*/
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog
index 7c1983fd4d6..00260c15f9c 100644
--- a/Build/source/texk/web2c/cwebdir/ChangeLog
+++ b/Build/source/texk/web2c/cwebdir/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-19 Andreas Scherer <https://ascherer.github.io>
+
+ * comm-w2c.ch: Extended notes about NLS activation.
+
2019-01-18 Andreas Scherer <https://ascherer.github.io>
* po/cweb.pot, po/de/cweb.po, po/it/cweb.po:
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index fa44e8ab8f8..9bba9ba0161 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -1239,6 +1239,31 @@ system by checking out the sources and translating the strings in files
\.{cweb.pot}, \.{cweb-tl.pot}, and \.{web2c-help.pot}, and submitting the
resulting \.{*.po} files to the maintainers at \.{tex-k@@tug.org}.
+\medskip \noindent \&{Note to maintainers:} \.{CWEB} in \TeX~Live generally
+does \\{not} set |HAVE_GETTEXT| at build-time, so \.{i18n} is ``off'' by
+default. If you want to create \.{CWEB} executables with NLS support, you
+have to recompile the \TeX~Live sources with a positive value for
+|HAVE_GETTEXT| both in \.{"comm-w2c.h"} and \.{"comm-w2c.h"}. Also you
+have to ``compile'' the NLS catalogs provided for \.{CWEB} in the source
+tree with \.{msgfmt} and store the resulting \.{.mo} files at an appropriate
+place in the file system.
+
+Plans for \TeX~Live are to store NLS catalogs inside the ``\TeX\ Directory
+Structure'' (TDS) and look them up with the help of the configuration variable
+``|TEXMFLOCALEFILES|'' (subject to change in the final setup). Below we use
+the \Kpathsea/ function |kpse_var_expand| to evaluate this variable from
+various origins and redirect the ``GNU~gettext utilities'' to a possibly
+different location than the canonical \.{/usr/share/locale}.
+
+There are several ways to set |TEXMFLOCALEFILES|:
+\smallskip
+{\parindent5em
+\item{(a)} a user-set environment variable \.{TEXMFLOCALEFILES}\hfil\break
+ (overridden by \.{TEXMFLOCALEFILES\_cweb});
+\item{(b)} a line in \Kpathsea/ configuration file \.{texmf.cnf},\hfil\break
+ e.g., \.{TEXMFLOCALEFILES=\$TEXMFDIST/locale}\hfil\break
+ or \.{TEXMFLOCALEFILES.cweb=\$TEXMFDIST/locale}.\par}
+
@d TEXMF_LOCALE "$TEXMFLOCALEFILES"
@<Set locale...@>=
@@ -1263,7 +1288,7 @@ The directories to be searched for come from three sources:
\smallskip
{\parindent5em
\item{(a)} a user-set environment variable \.{CWEBINPUTS}
- (overriden by \.{CWEBINPUTS\_cweb});
+ (overridden by \.{CWEBINPUTS\_cweb});
\item{(b)} a line in \Kpathsea/ configuration file \.{texmf.cnf},\hfil\break
e.g., \.{CWEBINPUTS=\$TEXMFDOTDIR:\$TEXMF/texmf/cweb//}\hfil\break
or \.{CWEBINPUTS.cweb=\$TEXMFDOTDIR:\$TEXMF/texmf/cweb//};
@@ -1283,16 +1308,10 @@ typedef bool boolean;
#define CWEB
#include "help.h"
-@q The simple file searching is replaced by the ``path searching'' mechanism @>
-@q that the \Kpathsea/ library provides.@>
-
@ We set |kpse_program_name| to `\.{cweb}'. This means if the variable
\.{CWEBINPUTS.cweb} is present in \.{texmf.cnf} (or \.{CWEBINPUTS\_cweb}
-in the environment) its value will be used as the search path for
-filenames. This allows different flavors of \.{CWEB} to have
-different search paths.
-
-@q \&{FIXME}: Not sure this is the best way to go about this. @>
+in the environment) its value will be used as the search path for filenames.
+This allows different flavors of \.{CWEB} to have different search paths.
@<Set up |PROGNAME| feature and initialize the search path mechanism@>=
kpse_set_program_name(argv[0], "cweb");
@@ -1315,9 +1334,6 @@ numbers.
Debugging output is always written to |stderr|, and begins with the string
`\.{kdebug:}'.
-@d show_kpathsea_debug flags['d']
- /* should results of file searching be shown? */
-
@* System dependent changes. The most volatile stuff comes at the very end.
@ Modules for dealing with help messages and version info.
@@ -1328,25 +1344,9 @@ cb_usagehelp(program==ctangle ? CTANGLEHELP :
@.--help@>
@ Special variants from \Kpathsea/ for i18n/t10n.
-
-@<Predecl...@>=
-void cb_show_banner (void); /* |extern| for option \.{+b} */
-static void cb_usage (const_string str);@/
-static void cb_usagehelp (const_string *message, const_string bug_email);@/
-
-@ We simply filter the strings through the catalog (if available).
+We simply filter the strings through the catalogs (if available).
@c
-void cb_show_banner (void)
-{
- assert(cb_banner[0]!='\0');
- textdomain("cweb-tl");
-@.cweb-tl.mo@>
- printf("%s%s\n", _(cb_banner), versionstring);
- textdomain("cweb");
-@.cweb.mo@>
-}
-
static void cb_usage (const_string str)
{
textdomain("cweb-tl");
@@ -1377,7 +1377,8 @@ static void cb_usagehelp (const_string *message, const_string bug_email)
history=spotless; exit(wrap_up());
}
-@ The version information will not be translated.
+@ The version information will not be translated, it uses a generic text
+template in English.
@<Display version information and |exit|@>=
printversionandexit(cb_banner,
@@ -1385,5 +1386,23 @@ printversionandexit(cb_banner,
NULL, NULL);
@.--version@>
+@ But the ``banner'' is, at least the first part.
+
+@c
+void cb_show_banner (void)
+{
+ assert(cb_banner[0]!='\0');
+ textdomain("cweb-tl");
+@.cweb-tl.mo@>
+ printf("%s%s\n", _(cb_banner), versionstring);
+ textdomain("cweb");
+@.cweb.mo@>
+}
+
+@ @<Predecl...@>=
+static void cb_usage (const_string str);@/
+static void cb_usagehelp (const_string *message, const_string bug_email);@/
+void cb_show_banner (void); /* |extern| for option \.{+b} */
+
@** Index.
@z