xref: /illumos-gate/usr/src/contrib/ast/src/cmd/msgcc/NOTES (revision b30d1939)
1da2e3ebdSchin2000-04-01 ast message catalog plan
2da2e3ebdSchin
3da2e3ebdSchin(1) error_info.dictionary should be error_info.catalog
4da2e3ebdSchin    to match xopen and the internal naming in our implementation
5da2e3ebdSchin    and also to more closely match the webster definition
6da2e3ebdSchin    (catalog == enumerated list)
7da2e3ebdSchin
8da2e3ebdSchin    DONE
9da2e3ebdSchin
10da2e3ebdSchin(2) nmake by default will
11da2e3ebdSchin	CATALOG = $(ID:N=+([A-Za-z0-9_]):?$(PWD:N=*/lib/*:Y,lib,,)$(ID)?$(PWD:B)?)
12da2e3ebdSchin	ERROR_CATALOG == "$(CATALOG)"
13da2e3ebdSchin    e.g., commands in src/cmd/std will use the "std" catalog; all of the
14da2e3ebdSchin    commands in src/lib/libcmd will use the "libcmd" catalog
15da2e3ebdSchin
16da2e3ebdSchin    nmake will add "[--catalog?$(CATALOG)]" to USAGE_LICENSE
17da2e3ebdSchin    optget() will set error_info.catalog if not defined on the first call
18da2e3ebdSchin    commands that don't emit messages before optget() need not change
19da2e3ebdSchin    otherwise the command should
20da2e3ebdSchin
21da2e3ebdSchin	error_info.id = "foo";
22da2e3ebdSchin	error_info.catalog = ERROR_CATALOG;
23da2e3ebdSchin
24da2e3ebdSchin    undefined references to { USAGE_LICENSE ERROR_CATALOG } are hard
25da2e3ebdSchin    compile time errors
26da2e3ebdSchin
27da2e3ebdSchin    DONE
28da2e3ebdSchin
29da2e3ebdSchin(3) add catalog argument to libcmd <cmd.h> cmdinit(argv, context, catalog)
30da2e3ebdSchin
31da2e3ebdSchin    DONE
32da2e3ebdSchin
33da2e3ebdSchin(4) msgcat global target build msgs/*.mso and $(CATALOG).msg
34da2e3ebdSchin    each Makefile will generate one catalog $(CATALOG).msg where
35da2e3ebdSchin
36da2e3ebdSchin    the *.msg files are weird -- we need to build them viewed over an
37da2e3ebdSchin    architecture specific tree, even though they will be eventually used
38da2e3ebdSchin    as architecture independent source
39da2e3ebdSchin
40da2e3ebdSchin    $(CATALOG).msg will be the "C" locale
41da2e3ebdSchin
42da2e3ebdSchin    debug will be a debugging locale that will translate each message to
43da2e3ebdSchin	(CATALOG-NAME:MESSAGE-INDEX)\n
44da2e3ebdSchin    this will make it easy to locate text that escaped translation (in what
45da2e3ebdSchin    should be translated output); it will also be a way for us to do
46da2e3ebdSchin    regression tests in the face of typo fixes -- presumably typos can be
47da2e3ebdSchin    fixed without changing the message index
48da2e3ebdSchin
49da2e3ebdSchin    see msgadmin(1)
50da2e3ebdSchin
51da2e3ebdSchin    DONE
52da2e3ebdSchin
53da2e3ebdSchin(5) once all this is working I'll do catopen(3) and msggen(1)
54da2e3ebdSchin
55da2e3ebdSchin    DONE
56da2e3ebdSchin
57da2e3ebdSchin(6) the makerules "all" action will
58da2e3ebdSchin	catgen $(CATALOG).cat
59da2e3ebdSchin	catgen $(CATALOG)-*.cat
60da2e3ebdSchin    and the makerules "install" action will copy the catgen output to
61da2e3ebdSchin	$(LOCALEDIR)/$(LOCALE)/LC_MESSAGES/$(CATALOG)*
62da2e3ebdSchin    where
63da2e3ebdSchin	LOCALEDIR = $(INSTALLROOT)/lib/locale
64da2e3ebdSchin
65da2e3ebdSchin    NOTE: still under consideration
66