summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/comm-w2c.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2019-01-15 16:17:07 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2019-01-15 16:17:07 +0000
commit37fbefc3e3140b96527887d8b6d3c99132635cf3 (patch)
tree2c76d813827c7caed6921545aeb73b89d41211c0 /Build/source/texk/web2c/cwebdir/comm-w2c.ch
parent8e94e1054f2e3c9f3412bef9f7a618b09e197b09 (diff)
Try to locate NLS catalogs in the TDS.
git-svn-id: svn://tug.org/texlive/trunk@49711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/comm-w2c.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch45
1 files changed, 30 insertions, 15 deletions
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index e6300f6c36f..9c1dc4c65db 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -1169,16 +1169,22 @@ standard C types for boolean values, pointers, and objects with fixed sizes.
#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.
+
+@s string int
+
+@d max_banner 50
+@d max_path_length (BUFSIZ-2)
@d PATH_SEPARATOR separators[0]
@d DIR_SEPARATOR separators[1]
@d DEVICE_SEPARATOR separators[2]
-@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 @@ interface, and catalog \.{web2c-help} contains the ``\.{--help}'' texts for
@.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");
+@.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 @@ The directories to be searched for come from three sources:
\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)