bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61734] [man] localize like other packages


From: G. Branden Robinson
Subject: [bug #61734] [man] localize like other packages
Date: Mon, 24 Jan 2022 11:59:00 -0500 (EST)

Update of bug #61734 (project groff):

                  Status:                   Fixed => In Progress            
             Open/Closed:                  Closed => Open                   

    _______________________________________________________

Follow-up Comment #2:

It turns out this wasn't done.


commit 57b3e1074f01b5a6cebc99461db1c19cb6720071
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Jan 24 20:21:47 2022 +1100

    [man]: Fix manual section title localization.

    Commit c64fd60dff was not quite cooked.  The localized strings (in
    English) for the manual section titles need to be set at every document
    load (i.e., when `TH` is called), but only if the groff locale is
    "english".  When switching locales, these strings were getting "stuck"
    in their non-English translations even when returning to an English
    page.

    * tmac/an.tmac (an*localize): New macro initializes strings.

      (TH): Call `an*localize` if the locale is "english".

      (initialization): Drop initialization of section title strings.

    Continues fixing <https://savannah.gnu.org/bugs/?61734>.

    Tested with several scenarios, including this one that starts out with a
    non-English page and then switches back and forth between languages.
    The package is not tripped up and the center header remains appropriate.

    $ ./build/test-groff -man -msv EXPERIMENTS/swedish.1 \
      tmac/en.tmac EXPERIMENTS/english.1 \
      tmac/sv.tmac EXPERIMENTS/swedish.1 \
      tmac/en.tmac EXPERIMENTS/english.1


...and even after that it _still_ wasn't done, because I forgot about
andoc.tmac.

Here's a further patch, pending for my next push.


diff --git a/tmac/trans.tmac b/tmac/trans.tmac
index d5257f52a..a06426b3e 100644
--- a/tmac/trans.tmac
+++ b/tmac/trans.tmac
@@ -31,7 +31,14 @@
 .\" trans.tmac should stay locale-independent.
 .
 .\" man package
-.if d an \{\
+.\"
+.\" Either an.tmac or andoc.tmac may already be loaded.
+.nr trans*is-man 0
+.
+.if d an         .nr trans*is-man 1
+.if d reload-man .nr trans*is-man 1
+.
+.if \n[trans*is-man] \{\
 .      als an*section1 \*[locale]-man-section1
 .      als an*section2 \*[locale]-man-section2
 .      als an*section3 \*[locale]-man-section3
@@ -43,6 +50,8 @@
 .      als an*section9 \*[locale]-man-section9
 .\}
 .
+.rr trans*is-man
+.
 .\" ms package
 .if r GS \{\
 .      als ABSTRACT \*[locale]-abstract



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61734>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]