summaryrefslogtreecommitdiff
path: root/tmac/LOCALIZATION
blob: 3f8a1cb82d383985276e9deb87b9fe709e210b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Localization
------------

The localization process involves two groff files and zero or more
hyphenation pattern files.

1.  A locale-dependent file (for example, fr.tmac for French) does one
    or several of the following.

    A.  A string identifying the groff locale (e.g., "english") is set.
    B.  Locale-specific strings used by macro packages are (re)defined.
    C.  The "trans.tmac" file is loaded with the .mso request to
        activate the strings set up in the previous item.
    C.  Other tweaks to macro package configuration are peformed, such
        as altering the ordering of the components of a date string.
    D.  Additional inter-sentence space is set to a language-appropriate
        amount with the .ss request.
    E.  A hyphenation mode appropriate to the hyphenation pattern files
        for the locale is set with the .hy request.
    F.  Hyphenation codes appropriate to the hyphenation pattern files
        for the locale are set with the .hcode request.
    G.  The hyphenation language is set with the .hla request.
    H.  Hyphenation pattern and exception files are loaded with the .hpf
        and .hpfa requests.
    I.  Support for a character encoding approriate to the locale is
        loaded with the .mso request.

2.  A locale-independent file (trans.tmac) activates the localized
    strings set up in item B above.

See the groff Texinfo manual in doc/groff.texi for descriptions of the
requests referred to above.

Localization files are named using ISO 639-1 language identifiers.
Further specialization of locales by ISO 3166 territory codes is
tentatively planned as of groff 1.23.0, awaiting expressions of demand.

After 'trans.tmac' has been loaded, you must redefine the date strings
in order to use the day and month names translated earlier.  The date
format also may need to be changed.

- If the locale's date format is MM/DD/YYYY, use the following.

    for ms: .ds DY \*[MO] \n[dy] \n[year]\"
    for mm: .ds cov*new-date \\*[MO\\n[mo]] \\n[dy] \\n[year]\"
    for me: .ds td \*(mo \n(dy \n(y4\"

- If the locale's date format is DD/MM/YYYY, use the following.

    for ms: .ds DY \n[dy] \*[MO] \n[year]\"
    for mm: .ds cov*new-date \\n[dy] \\*[MO\\n[mo]] \\n[year]\"
    for me: .ds td \n(dy \*(mo \n(y4\"

Other date formats can be handled similarly.

Note: For the mm package, in the 'ISODATE' macro, only the first
definition of 'cov*new-date' must be changed (see 'fr.tmac').