groff
[Top][All Lists]
Advanced

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

[Groff] Translations


From: Larry Kollar
Subject: [Groff] Translations
Date: Tue, 31 Mar 2009 16:42:55 -0400

One of the manuals I maintain in my day job is in groff, and (to my surprise) I had to have it translated. The translators managed to not muck up things *too* badly -- there were a few lines that got run together in error and a couple macro and cross-ref names that got translated, but they know to watch for that next time now.

Since I'm not maintaining the translations, I ran the files through preconv to fix the accented glyphs permanently (some of the files were Latin-1 and others UTF-8, which gave preconv heartburn when run using groff -k). Indexing, of course, was interesting. Here's a patch to the Bentley/Kernighan indexing scripts (CSTR 128) that increases preconv-awareness:

--- gen.key.old 2009-03-31 08:30:39.000000000 -0400
+++ gen.key     2009-03-31 12:35:41.000000000 -0400
@@ -21,6 +21,16 @@
        # Remove some troff commands
        gsub(/\\f\(..|\\f.|\\s[+-][0-9]|\\s[0-9][0-9]?/, "", $2)

+       # de-accent Latin characters (assuming preconv for now)
+       gsub(/\\\[u00E0\]/, "a", $2);
+       gsub(/\\\[u00E1\]/, "a", $2);
+       gsub(/\\\[u00E2\]/, "a", $2);
+       gsub(/\\\[u00E8\]/, "e", $2);
+       gsub(/\\\[u00E9\]/, "e", $2);
+       gsub(/\\\[u00ED\]/, "i", $2);
+       gsub(/\\\[u00F3\]/, "o", $2);
+       gsub(/\\\[u00F1\]/, "n", $2);
+
        # underscore -> 0, so "foo_gorp" sorts before "food"
        gsub(/_/, "0", $2)

--- format.old  2006-05-23 10:30:49.000000000 -0400
+++ format      2009-03-31 11:09:05.000000000 -0400
@@ -35,6 +35,9 @@
        else
                $0 = $2

+       # preserve Unicode glyphs (\[u....] - preconv awareness)
+       gsub( /(\[u....\])/, "%\&%", $0 );
+
        if ($0 ~ /%/) {
                quoted = 1


The gen.key patch probably needs to be filled out a little more, but this was enough to get my project properly sorted (pun not intended). Aside from the few glitches, most of which are a matter of familiarity (or lack thereof), the project went reasonably smoothly.

I'm sure the hyphenation is a little wonky... there's a hyphen.fr file (which I assume could be used for proper French hyphenation, if installed properly). Is there anywhere I could grab a Spanish hyphenation file?

-- Larry






reply via email to

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