texlive[49711] Build/source/texk/web2c: Try to locate NLS catalogs in

commits+ascherer at tug.org commits+ascherer at tug.org
Tue Jan 15 17:17:07 CET 2019


Revision: 49711
          http://tug.org/svn/texlive?view=revision&revision=49711
Author:   ascherer
Date:     2019-01-15 17:17:07 +0100 (Tue, 15 Jan 2019)
Log Message:
-----------
Try to locate NLS catalogs in the TDS.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    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/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2019-01-15 01:23:26 UTC (rev 49710)
+++ trunk/Build/source/texk/web2c/ChangeLog	2019-01-15 16:17:07 UTC (rev 49711)
@@ -1,3 +1,7 @@
+2019-01-15  Andreas Scherer  <https://ascherer.github.io>
+
+	* cwebboot.cin: Provisional 'bindtextdomain' lookup in TDS.
+
 2019-01-10  Andreas Scherer  <https://ascherer.github.io>
 
 	* help.h (CTWILLHELP): update.

Modified: trunk/Build/source/texk/web2c/cwebboot.cin
===================================================================
--- trunk/Build/source/texk/web2c/cwebboot.cin	2019-01-15 01:23:26 UTC (rev 49710)
+++ trunk/Build/source/texk/web2c/cwebboot.cin	2019-01-15 16:17:07 UTC (rev 49711)
@@ -31,7 +31,7 @@
 #include <stdint.h>  
 
 /*:85*//*88:*/
-#line 1205 "cwebdir/comm-w2c.ch"
+#line 1211 "cwebdir/comm-w2c.ch"
 
 #include <locale.h> 
 
@@ -48,7 +48,7 @@
 #endif
 
 /*:88*//*90:*/
-#line 1263 "cwebdir/comm-w2c.ch"
+#line 1278 "cwebdir/comm-w2c.ch"
 
 typedef bool boolean;
 #define HAVE_BOOLEAN
@@ -171,12 +171,13 @@
 #define C_printf(c,a) fprintf(C_file,c,a) 
 #define C_putc(c) putc(c,C_file)  \
 
+#define max_banner 50
+#define max_path_length (BUFSIZ-2)  \
+
 #define PATH_SEPARATOR separators[0]
 #define DIR_SEPARATOR separators[1]
 #define DEVICE_SEPARATOR separators[2] \
 
-#define max_banner 50 \
-
 #define _(STRING) gettext(STRING)  \
 
 #define kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true)  \
@@ -331,9 +332,11 @@
 char*change_limit;
 
 /*:11*//*86:*/
-#line 1180 "cwebdir/comm-w2c.ch"
+#line 1184 "cwebdir/comm-w2c.ch"
 
 char cb_banner[max_banner];
+char locale_path[max_path_length]= "/usr/share/locale/";
+string texmf_locale;
 #ifndef SEPARATORS
 #define SEPARATORS "://"
 #endif
@@ -425,7 +428,7 @@
 static void prime_the_change_buffer(void);
 
 /*:84*//*95:*/
-#line 1319 "cwebdir/comm-w2c.ch"
+#line 1334 "cwebdir/comm-w2c.ch"
 
 void cb_show_banner(void);
 static void cb_usage(const_string str);
@@ -465,7 +468,7 @@
 #line 72 "cwebdir/comm-w2c.ch"
 
 /*91:*/
-#line 1284 "cwebdir/comm-w2c.ch"
+#line 1299 "cwebdir/comm-w2c.ch"
 
 kpse_set_program_name(argv[0],"cweb");
 
@@ -473,12 +476,20 @@
 #line 73 "cwebdir/comm-w2c.ch"
 
 /*89:*/
-#line 1236 "cwebdir/comm-w2c.ch"
+#line 1242 "cwebdir/comm-w2c.ch"
 
 setlocale(LC_MESSAGES,setlocale(LC_CTYPE,""));
-bindtextdomain("cweb","/usr/share/locale/");
-bindtextdomain("cweb-tl","/usr/share/locale/");
-bindtextdomain("web2c-help","/usr/share/locale/");
+texmf_locale= kpse_var_expand("$TEXMFLOCALEFILES");
+if(texmf_locale){
+if(strlen(texmf_locale)<max_path_length)
+sprintf(locale_path,"%s",texmf_locale);
+else err_print("! Include path too long");
+
+free(texmf_locale);
+}
+bindtextdomain("cweb",locale_path);
+bindtextdomain("cweb-tl",locale_path);
+bindtextdomain("web2c-help",locale_path);
 textdomain("cweb");
 
 
@@ -1341,7 +1352,7 @@
 #line 774 "cwebdir/comm-w2c.ch"
 
 /*87:*/
-#line 1190 "cwebdir/comm-w2c.ch"
+#line 1196 "cwebdir/comm-w2c.ch"
 
 if(C_file)fclose(C_file);
 if(tex_file)fclose(tex_file);
@@ -1425,7 +1436,7 @@
 if(strcmp("-help",*argv)==0||strcmp("--help",*argv)==0)
 
 /*94:*/
-#line 1312 "cwebdir/comm-w2c.ch"
+#line 1327 "cwebdir/comm-w2c.ch"
 
 cb_usagehelp(program==ctangle?CTANGLEHELP:
 program==cweave?CWEAVEHELP:CTWILLHELP,NULL);
@@ -1437,7 +1448,7 @@
 if(strcmp("-version",*argv)==0||strcmp("--version",*argv)==0)
 
 /*97:*/
-#line 1369 "cwebdir/comm-w2c.ch"
+#line 1384 "cwebdir/comm-w2c.ch"
 
 printversionandexit(cb_banner,
 program==ctwill?"Donald E. Knuth":"Silvio Levy and Donald E. Knuth",
@@ -1625,7 +1636,7 @@
 
 #line 953 "cwebdir/comm-w2c.ch"
 /*:70*//*96:*/
-#line 1326 "cwebdir/comm-w2c.ch"
+#line 1341 "cwebdir/comm-w2c.ch"
 
 void cb_show_banner(void)
 {

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2019-01-15 01:23:26 UTC (rev 49710)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2019-01-15 16:17:07 UTC (rev 49711)
@@ -1,3 +1,7 @@
+2019-01-15  Andreas Scherer  <https://ascherer.github.io>
+
+	* comm-w2c.ch: Provisional 'bindtextdomain' lookup in TDS.
+
 2019-01-05  Andreas Scherer  <https://ascherer.github.io>
 
 	Integration of CWEBbin as the new CWEB in TeX Live,

Modified: trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2019-01-15 01:23:26 UTC (rev 49710)
+++ trunk/Build/source/texk/web2c/cwebdir/comm-w2c.ch	2019-01-15 16:17:07 UTC (rev 49711)
@@ -1169,16 +1169,22 @@
 #include <stddef.h> /* type definition of |ptrdiff_t| */
 #include <stdint.h> /* type definition of |uint8_t| et al. */
 
-@ The |scan_args| and |cb_show_banner| routines need a few extra variables.
+@ The |scan_args| and |cb_show_banner| routines and the |bindtextdomain|
+argument string need a few extra variables.
 
+ at s string int
+
+ at d max_banner 50
+ at d max_path_length (BUFSIZ-2)
+
 @d PATH_SEPARATOR   separators[0]
 @d DIR_SEPARATOR    separators[1]
 @d DEVICE_SEPARATOR separators[2]
 
- at d max_banner 50
-
 @<Other...@>=
-char cb_banner[max_banner];
+char cb_banner[max_banner];@/
+char locale_path[max_path_length]="/usr/share/locale/";@/
+string texmf_locale;@/
 #ifndef SEPARATORS
 #define SEPARATORS "://"
 #endif
@@ -1228,16 +1234,24 @@
 @.web2c-help.mo@>
 @.--help@>
 
-If such translation files are not available you may want to improve this 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}.
+If such translation files are not available, you may want to improve this
+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}.
 
 @<Set locale...@>=
 setlocale(LC_MESSAGES, setlocale(LC_CTYPE, ""));
-bindtextdomain("cweb", "/usr/share/locale/");
-bindtextdomain("cweb-tl", "/usr/share/locale/");
-bindtextdomain("web2c-help", "/usr/share/locale/");
+texmf_locale = kpse_var_expand ("$TEXMFLOCALEFILES");
+if (texmf_locale) {
+  if (strlen(texmf_locale) < max_path_length)
+    sprintf(locale_path,"%s",texmf_locale);
+  else err_print("! Include path too long");
+ at .Include path too long@>
+  free(texmf_locale);
+}
+bindtextdomain("cweb", locale_path);
+bindtextdomain("cweb-tl", locale_path);
+bindtextdomain("web2c-help", locale_path);
 textdomain("cweb"); /* the majority of |"strings"| come from ``plain \.{CWEB}'' */
 @.cweb.mo@>
 
@@ -1253,10 +1267,11 @@
 \item{(a)} a user-set environment variable \.{CWEBINPUTS}
     (overriden by \.{CWEBINPUTS\_cweb});
 \item{(b)} a line in \Kpathsea/ configuration file \.{texmf.cnf},\hfil\break
-    e.g. \.{CWEBINPUTS=.:\$TEXMF/texmf/cweb//}
-    or \.{CWEBINPUTS.cweb=.:\$TEXMF/texmf/cweb//};
-\item{(c)} compile-time default directories \.{.:\$TEXMF/texmf/cweb//}
-    (specified in \.{texmf.in}).}
+    e.g., \.{CWEBINPUTS=\$TEXMFDOTDIR:\$TEXMF/texmf/cweb//}\hfil\break
+    or \.{CWEBINPUTS.cweb=\$TEXMFDOTDIR:\$TEXMF/texmf/cweb//};
+\item{(c)} compile-time default directories (specified in
+    \.{texmf.in}),\hfil\break
+    i.e., \.{\$TEXMFDOTDIR:\$TEXMF/texmf/cweb//}.\par}
 
 @d kpse_find_cweb(name) kpse_find_file(name,kpse_cweb_format,true)
 



More information about the tex-live-commits mailing list