bugGNU roff - Bugs: bug #61123, make macro package localization...

 
 

bug #61123: make macro package localization more robust

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 07 Sep 2021 08:39:43 AM UTC
   
 
Category:  Macro - others/general Severity:  1 - Wish
Item Group:  Feature change Status:  None
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Jan 2022 10:35:52 AM UTC, comment #2: 

The localization work I did recently on me(7) is an example of what I had in mind here.  It features a `_td_format` string from which the `td` string is (re-)generated, and exposes an `ld` macro to make that happen.

G. Branden Robinson <gbranden>
Group administrator
Thu 28 Oct 2021 05:47:59 AM UTC, comment #1: 

As part of this I want to expose the man(1) volume titles to translation as well.  Structurally, comparing the an.tmac package to the other full-service packages {e,m,om,s}.tmac, there is a clear disparity.

I wish to pre-acknowledge that Ingo thinks this is a bad idea, or did within the past couple of years; his view is that man pages should not be translated, because, IIRC, anyone with the technical competence to read Unix man pages should have at least a moderate command of English.

That's policy, however, not mechanism, and distributors like Debian have clearly made a different choice.  In fact, I think I can mine Debian's package repository for translations of the trivial number of strings for which an.tmac requires translation.


.  ds an-section "\\$2\"
.  ie (\\n[.$] > 4)    .ds an-extra3 "\\$5\"
.  el \{ .ie '\\$2'1'  .ds an-extra3 General Commands Manual\"
.  el \{ .ie '\\$2'2'  .ds an-extra3 System Calls Manual\"
.  el \{ .ie '\\$2'3'  .ds an-extra3 Library Functions Manual\"
.  el \{ .ie '\\$2'4'  .ds an-extra3 Kernel Interfaces Manual\"
.  el \{ .ie '\\$2'5'  .ds an-extra3 File Formats Manual\"
.  el \{ .ie '\\$2'6'  .ds an-extra3 Games Manual\"
.  el \{ .ie '\\$2'7'  .ds an-extra3 Miscellaneous Information Manual\"
.  el \{ .ie '\\$2'8'  .ds an-extra3 System Manager's Manual\"
.  el \{ .ie '\\$2'9'  .ds an-extra3 Kernel Developer's Manual\"
.  el                  .ds an-extra3 \" empty
.  \}\}\}\}\}\}\}\}\}


I don't propose to deal with mdoc at this time; it's a heavier lift.


G. Branden Robinson <gbranden>
Group administrator
Tue 07 Sep 2021 08:39:43 AM UTC, original submission:  

In a message to the groff dev list[1], I said:

> the groff 1.22.4 documentation told people that they had to be sure to specify the localization macro package as the last -m argument on the command line.  This felt fragile to me.


> It is not clear to me now why this might be the case.  I've been doing all kinds of janitorial robustification over the past few years, and either that or changes before I started working on groff made the claim inaccurate.


I figured out why it was there.  It involves using localization macro files with other macro packages.  The string assignments (themselves indirected through the \*[locale] string) need to be performed afresh when the groff locale changes, and the conditionals run for me(7), mm, and ms (re-)executed.

It looks like one way to approach this would be to pull most of the content of tmac/trans.tmac into a macro, perhaps with `.de1 reinitialize-localization` or similar, and then not only have trans.tmac call the macro it just defined, but also have the macro packages call that macro as part of their initialization.

Interesting test cases may involve setting the date (or not), and ensuring that a localized date string is updated appropriately as the input language changes.  A complicating factor is the ms package, which permits the argument to its DA and ND macros to be something other than a date.  If the user calls such macros, the argument should not be updated by a groff locale, because it might not be a date at all.  Setting a package-specific flag will , I suspect, take care of this.  If an ms document author calls DA/ND and it has localizable content, they'll need to take care of it themselves when changing languages.

[1] https://lists.gnu.org/archive/html/groff/2021-07/msg00018.html

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code