texlive[49756] Build/source/texk/web2c: Extended description for NLS

commits+ascherer at tug.org commits+ascherer at tug.org
Sat Jan 19 12:08:31 CET 2019


Revision: 49756
          http://tug.org/svn/texlive?view=revision&revision=49756
Author:   ascherer
Date:     2019-01-19 12:08:31 +0100 (Sat, 19 Jan 2019)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebboot.cin
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch

Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin	2019-01-19 01:23:21 UTC (rev 49755)
+++ trunk/Build/source/texk/web2c/cwebboot.cin	2019-01-19 11:08:31 UTC (rev 49756)
@@ -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 @@
 #define CWEB
 #include "help.h"
 
-
-
-
 /*:90*/
 #line 59 "cwebdir/common.w"
 
@@ -186,10 +183,7 @@
 
 #define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true)  \
 
-#define show_kpathsea_debug flags['d'] \
- \
 
-
 #line 60 "cwebdir/common.w"
 
 /*2:*/
@@ -430,14 +424,14 @@
 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 @@
 #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 @@
 #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(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,8 +1440,8 @@
 
 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",
@@ -1454,7 +1448,7 @@
 NULL,NULL);
 
 
-/*:97*/
+/*:96*/
 #line 1000 "cwebdir/comm-w2c.ch"
 
 if(strcmp("-verbose",*argv)==0||strcmp("--verbose",*argv)==0)
@@ -1636,19 +1630,9 @@
 }
 
 #line 953 "cwebdir/comm-w2c.ch"
-/*:70*//*96:*/
-#line 1339 "cwebdir/comm-w2c.ch"
+/*:70*//*95:*/
+#line 1349 "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");
-
-}
-
 static void cb_usage(const_string str)
 {
 textdomain("cweb-tl");
@@ -1679,4 +1663,17 @@
 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*/

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2019-01-19 01:23:21 UTC (rev 49755)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2019-01-19 11:08:31 UTC (rev 49756)
@@ -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:

Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2019-01-19 01:23:21 UTC (rev 49755)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2019-01-19 11:08:31 UTC (rev 49756)
@@ -1239,6 +1239,31 @@
 \.{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 @@
 \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,17 +1308,11 @@
 #define CWEB
 #include "help.h"
 
- at q The simple file searching is replaced by the ``path searching'' mechanism @>
- at 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.
+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.
 
- at q \&{FIXME}: Not sure this is the best way to go about this. @>
-
 @<Set up |PROGNAME| feature and initialize the search path mechanism@>=
 kpse_set_program_name(argv[0], "cweb");
 
@@ -1315,9 +1334,6 @@
 Debugging output is always written to |stderr|, and begins with the string
 `\.{kdebug:}'.
 
- at 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 @@
 @.--help@>
 
 @ Special variants from \Kpathsea/ for i18n/t10n.
+We simply filter the strings through the catalogs (if available).
 
-@<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).
-
 @c
-void cb_show_banner (void)
-{
-  assert(cb_banner[0]!='\0');
-  textdomain("cweb-tl");
- at .cweb-tl.mo@>
-  printf("%s%s\n", _(cb_banner), versionstring);
-  textdomain("cweb");
- at .cweb.mo@>
-}
-
 static void cb_usage (const_string str)
 {
   textdomain("cweb-tl");
@@ -1377,7 +1377,8 @@
   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 @@
   NULL, NULL);
 @.--version@>
 
+@ But the ``banner'' is, at least the first part.
+
+ at c
+void cb_show_banner (void)
+{
+  assert(cb_banner[0]!='\0');
+  textdomain("cweb-tl");
+ at .cweb-tl.mo@>
+  printf("%s%s\n", _(cb_banner), versionstring);
+  textdomain("cweb");
+ at .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



More information about the tex-live-commits mailing list