Hi Bento,

have a look at groff_mm and search for the section "Localization". There
you'll find more information.

Usually, if you specify the language on the command line as indicated in
man groff_mm, then you will not need any control over conditional
loading of macro files.

The manual explains how conditions are specified:
https://www.gnu.org/software/groff/manual/groff.html.node/if_002delse.html

Sourcing a macro file is straightforward:

.so mymacro.tmac

which can be in the body of a conditional structure.

Also, you can include formatting instructions (like italics) in string
definitions without any difficulty.

Best regards,

Oliver.


On 09/11/2024 20:34, Bento Borges Schirmer wrote:
Hey Oliver,

Em sex., 8 de nov. de 2024 às 19:05, Oliver Corff via GNU roff
typesetting system discussion<groff@gnu.org> escreveu:
Check, e.g. the macro files trans.tmac, de.tmac, sv.tmac, cs.tmac,
fr.tmac etc.in /usr/share/groff/1.23.0/tmac

They demonstrate the mechanism how you can use string macros with good
mnemonic names that issue the names of months, days etc. according to
selected language, including a lot of phrases necessary for writing letters.
I glanced at the files. I saw nothing for portuguese (groff 1.23.0),
but I always come across man pages in portuguese! [1]
In the future I could work to provide some pt.tmac and a hyphen.pt,
but maybe the people from Debian [2] already did it? I don't know.
Anyway, the month names mnemonics are useful!

I translated a little more yesterday. I noticed some patterns.

1. More common words like "e" and "and" could benefit from mnemonics
2. Loanwords are widespread in portuguese. The most common are not
italicized, but the remainder are. Some mechanism would be useful to
automatically italicize.
3. Borrowing from C's #ifdef #else #endif conditional compilation, it
would be useful to define regions that disappear and reappear
depending on language.

I'm just thinking. Except regarding "e" and "and", I don't think I'll
put any additional effort for now haha.

Best regards,
Bento

[1]https://man.archlinux.org/listing/extra/man-pages-pt_br/
[2]https://salsa.debian.org/manpages-l10n-team/manpages-l10n

--

Dr. Oliver Corff
Mail:oliver.co...@email.de

Reply via email to