commit 4eb1e209c8ebac3c1c62b7a51ce031ed7a6baffb Author: G. Branden Robinson AuthorDate: Mon Jan 4 17:53:05 2021 +1100 Commit: G. Branden Robinson CommitDate: Mon Jan 4 18:01:00 2021 +1100 tmac/troffrc: Derive groff locale from system. Determine the groff locale (default input language) using the system locale. Determine the groff locale from the environment if possible. Try LC_ALL first, then LANG. "C" means English (en). Unrecognized locales are ignored, and groff falls back to English. Those who want groff's default locale to differ from LC_ALL/LANG should edit this troffrc to source the appropriate groff locale macro file (cs.tmac, de.tmac, den.tmac, fr.tmac, ja.tmac, sv.tmac, zh.tmac). Also wrap a long line. diff --git a/tmac/troffrc b/tmac/troffrc index c562676b..a5bf85a0 100644 --- a/tmac/troffrc +++ b/tmac/troffrc @@ -31,7 +31,8 @@ .do if d troffrc!\*[.T] \ . do mso \*[troffrc!\*[.T]] .do rm troffrc!ps troffrc!Xps troffrc!dvi troffrc!X75 troffrc!X75-12 \ -troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html troffrc!pdf +troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html \ +troffrc!pdf . .\" Test whether we work under EBCDIC and map the no-breakable space .\" character accordingly. @@ -40,12 +41,26 @@ troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html troffrc!pdf .el \ . do tr \[char65]\~ . -.\" Set the hyphenation language to English. -.do hla en . -.\" Load hyphenation patterns and exceptions. -.do hpf hyphen.en -.do hpfa hyphenex.en +.\" Determine the groff locale from the environment if possible. Try +.\" LC_ALL first, then LANG. "C" means English (en). +.do ds troffrc!language \V[LC_ALL] +.do if '\*[troffrc!language]'' \{\ +. do ds troffrc!language \V[LANG] +. do if '\*[troffrc!language]'' \ +. do ds troffrc!language C +.\} +.do if '\*[troffrc!language]'C' \ +. do ds troffrc!language en +.\" XXX: Consider not merging this until we have a "quiet" version of +.\" .mso (and .so). +.do mso \*[troffrc!language].tmac +.do rm troffrc!language +.\" If the configured system locale has no groff localization, fall back +.\" to English. +.do if '\*[locale]'' \ +. mso en.tmac +. . .\" Handle paper formats. .do mso papersize.tmac commit 306296344b2910f20579baa6db6eef1a8a4a3e0f Author: G. Branden Robinson AuthorDate: Mon Jan 4 17:44:57 2021 +1100 Commit: G. Branden Robinson CommitDate: Mon Jan 4 17:44:57 2021 +1100 tmac/en.tmac: Add English localization file. diff --git a/tmac/en.tmac b/tmac/en.tmac new file mode 100644 index 00000000..6aae40db --- /dev/null +++ b/tmac/en.tmac @@ -0,0 +1,38 @@ +.\" English localization for groff +.\" +.\" Copyright (C) 2021 Free Software Foundation, Inc. +.\" +.\" This file is part of groff. +.\" +.\" groff is free software; you can redistribute it and/or modify it +.\" under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" groff is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +.\" License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. If not, see +.\" . +.\" +.\" Please send comments to groff@gnu.org. +. +.ds locale english\" +. +.\" Set the hyphenation language to English. +.do hla en +. +.\" Load hyphenation patterns and exceptions. +.do hpf hyphen.en +.do hpfa hyphenex.en +. +. +.\" Local Variables: +.\" mode: nroff +.\" coding: latin-1 +.\" fill-column: 72 +.\" End: +.\" vim: set filetype=groff textwidth=72: commit e24e939d3518b069b034d9fcd1c25ea97ddc771f Author: G. Branden Robinson AuthorDate: Mon Jan 4 17:10:20 2021 +1100 Commit: G. Branden Robinson CommitDate: Mon Jan 4 17:11:51 2021 +1100 [troffrc]: Change hyphenation language us to en. The first-order determinant of hyphenation points is language, not territory. Use ISO 639 2-letter language codes for hyphenation and exception patterns instead of ISO 3166 2-letter territory codes. diff --git a/tmac/troffrc b/tmac/troffrc index 2b2975d0..c562676b 100644 --- a/tmac/troffrc +++ b/tmac/troffrc @@ -40,12 +40,12 @@ troffrc!X100 troffrc!X100-12 troffrc!lj4 troff!lbp troffrc!html troffrc!pdf .el \ . do tr \[char65]\~ . -.\" Set the hyphenation language to 'us'. -.do hla us +.\" Set the hyphenation language to English. +.do hla en . .\" Load hyphenation patterns and exceptions. -.do hpf hyphen.us -.do hpfa hyphenex.us +.do hpf hyphen.en +.do hpfa hyphenex.en . .\" Handle paper formats. .do mso papersize.tmac commit fde7035d02490c1c055c01718a6645f8b225ed5e Author: G. Branden Robinson AuthorDate: Mon Jan 4 16:59:03 2021 +1100 Commit: G. Branden Robinson CommitDate: Mon Jan 4 17:11:41 2021 +1100 tmac: Rename *.us to *.en. The first-order determinant of hyphenation points is language, not territory. Use ISO 639 2-letter language codes for hyphenation and exception patterns instead of ISO 3166 2-letter territory codes. diff --git a/tmac/hyphen.us b/tmac/hyphen.en similarity index 100% rename from tmac/hyphen.us rename to tmac/hyphen.en diff --git a/tmac/hyphenex.us b/tmac/hyphenex.en similarity index 100% rename from tmac/hyphenex.us rename to tmac/hyphenex.en