Gettextize the source, make library strings translatable.
[libguestfs.git] / HACKING
1 PLEASE LOOK AT THE TOP OF EACH FILE BEFORE EDITING TO SEE WHETHER IT
2 IS AUTOMATICALLY GENERATED OR NOT.
3
4 Adding a new action
5 ----------------------------------------------------------------------
6
7 All action functions are generated automatically, so there are only
8 two files you need to edit:
9
10 (1) src/generator.ml: Add your new action, parameters, description,
11 etc. to the big list called 'functions' at the top of this file.
12
13 (2) Edit/create a C file in daemon/ subdirectory which implements your
14 'do_action' function.  Take a look at one of the numerous examples
15 there.
16
17 You will need to run src/generator.ml (from the top directory) which
18 regenerates all the auto-generated files, and then continue with the
19 ordinary build process.
20
21 Formatting
22 ----------------------------------------------------------------------
23
24 Try to use GNU / Emacs default formatting, following the convention
25 used elsewhere in the source.
26
27 Please make sure that the code compiles without warnings.
28
29 Please test any changes.
30
31 Directories
32 ----------------------------------------------------------------------
33
34 contrib/
35         Outside contributions, experimental parts.
36
37 daemon/
38         The daemon that runs inside the guest and carries out actions.
39
40 examples/
41         The examples.
42
43 fish/
44         Guestfish (the command-line program / shell)
45
46 haskell/
47         Haskell bindings.
48
49 images/
50         Some guest images to test against.  These are gzipped to save
51         space.  You have to unzip them before use.
52
53         Also contains some files used by the test suite.
54
55 inspector/
56         Virtual machine image inspector (virt-inspector).
57
58 java/
59         Java bindings.
60
61 m4/
62         M4 macros used by autoconf.
63
64 ocaml/
65         OCaml bindings.
66
67 po/
68         Translations.
69
70 perl/
71         Perl bindings.
72
73 python/
74         Python bindings.
75
76 ruby/
77         Ruby bindings.
78
79 src/
80         Source code to the C library.
81         Also contains the crucial generator program.
82
83 Debugging
84 ----------------------------------------------------------------------
85
86 It's a good idea to use guestfish to try out new commands.
87
88 Debugging the daemon is a problem because it runs inside a minimal
89 qemu environment.  However you can print messages from the daemon, and
90 they will show up if you use 'guestfish -v'.
91
92 Patches
93 ----------------------------------------------------------------------
94
95 Submit patches to the fedora-virt mailing list:
96 http://www.redhat.com/mailman/listinfo/fedora-virt
97 and CC to rjones@redhat.com
98
99 I18N
100 ----------------------------------------------------------------------
101
102 We support i18n (gettext anyhow) in the library.
103
104 However many messages come from the daemon, and we don't translate
105 those at the moment.  One reason is that the appliance generally has
106 all locale files removed from it, because they take up a lot of space.
107 So we'd have to readd some of those, as well as copying our PO files
108 into the appliance.
109
110 Debugging messages are never translated, since they are intended for
111 the programmers.