summaryrefslogtreecommitdiff
path: root/docs/i18n/EventSourceGenerator
blob: 79e79b224d27f2b4e62059b13763f5b33a8ceaef (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
Idea:
- the master is gettext, a logger and a set of category, message ids in a
  header file
- produce an .mc file from it, which can be used in the event logger
  application as message/category DLL
- maybe its awk/sed in the beginning

Links:
- members.tripod.com/~ashimg/Parser.html
- cscope
- mcpp_lib

we must find all wolf_log calls in a given set of source files (in this case
libwolf.dll), later we also need a merger for at least wolfmsg.mc and app.mc

foreach call to wolf_log we get:
- wolf level:  must be mapped to 'Severity'
- the category_id (is passed in ReportEvent directly, we don't need it to
  generate the MC file, also the categories and their names are few and
  change not too often, so we hard-code them)
- message_id (we need it here expanded)
  - the Severity, the Facility and the message_id form the 'MessageId'
- _( ) format string or message: this is the msgid in gettext and gets
  the English version in the MC file
- for each msgid we must search for the msgstr in the corresponding gettext
  file and map it to the right language
- The 'SymbolicName' is tricky: we need the define from log/messages.h,
  unexpanded

1) Easy way to find all calls of wolf_log with macros correctly expanded
find . -name '*.c' -exec cat {} \; | mcpp -DLINUX
 -DOS_MAJOR_VERSION=2 -DOS_MINOR_VERSION=6 -DENABLE_NLS=1 -I. -I
- /usr/lib/gcc/i686-pc-linux-gnu/4.3.3/include -I../include/wolf | grep
- / wolf_log\(

2) The logger must map the messageid correcly (masks)

3) Sort out the problems with message.dll installation and the registry in
   the event source