1OCAML-GETTEXT(1) OCAML-GETTEXT(1)
2
3
4
6 ocaml-gettext - program to manage PO and MO files for OCaml source
7 files.
8
10 ocaml-gettext --action verb options* [file...]
11
13 This manual page documents briefly the ocaml-gettext command.
14
15 --action extract
16 Files provided are considered to be OCaml source files and
17 ocaml-gettext tries to extract translatable strings of it. The
18 output of the command is a POT file. As a special case, if a
19 file named POTFILES is in the list of the file provided, every
20 line of it is considered as a file to be searched.
21
22 --action compile
23 Files provided are considered to be PO file. These files are
24 compiled in binary MO files,
25
26 --action install
27 Files provided are considered to be MO files. They are in‐
28 stalled in their respective directories considering language,
29 textdomain and category,
30
31 --action uninstall
32 This is the symmetric command to install, but it uninstalls
33 files provided for the considered language, textdomain and cate‐
34 gory,
35
36 --action merge
37 Merges a POT file with the provided PO file.
38
39 --extract-command cmd
40 Command to extract translatable strings from an OCaml source
41 file. This command should output the same marshalled structure
42 as ocaml-xgettext. The best to do is to use the same build ver‐
43 sion of ocaml-gettext.
44
45 --extract-default-option options
46 Default options used when extracting translatable strings.
47 These options are camlp4 options and will be passed to
48 ocaml-xgettext when processing files that don't already have
49 specific camlp4 options.
50
51 --extract-filename-option filename options
52 Specific filename camlp4 options. It is used when extracting
53 strings from the specified filename. It overrides default
54 camlp4 options.
55
56 --extract-pot filename
57 POT file to write when extracting translatable strings.
58
59 --compile-output filename
60 MO file to write when compiling a PO file. If not provided, the
61 output will be the name of the PO file with ".mo" extension.
62
63 --install-language language
64 Language to use when installing a MO file.
65
66 --install-category category
67 Category to use when installing a MO file.
68
69 --install-textdomain textdomain
70 Textdomain to use when installing a MO file.
71
72 --install-destdir dirname
73 Base directory to use when installing a MO file.
74
75 --uninstall-language language
76 Language to use when uninstalling a MO file.
77
78 --uninstall-category category
79 Category to use when uninstalling a MO file.
80
81 --uninstall-textdomain textdomain
82 Textdomain to use when uninstalling a MO file.
83
84 --uninstall-orgdir dirname
85 Base directory used when uninstalling a MO file.
86
87 --merge-pot filename
88 POT file to use as a master for merging PO file.
89
90 --merge-backup-extension extension
91 Backup extension to use when moving PO file which have been
92 merged.
93
94 --version
95 Return version information on ocaml-gettext.
96
97 --short-version
98 Returns only the version of ocaml-gettext. The return is made
99 to be easily parseable by configure script. The output of this
100 command will always be the shortest version string, made of nu‐
101 meric characters (0-9) and ".". The version strings should be
102 compared considering that a version A is greater than a version
103 B if there is a number between two "." of A that is greater than
104 B the corresponding number, beginning at the right of the
105 string. For example: 0.14 is greater than 0.13.1.
106
107 -help, --help
108 Displays the help about the ocaml-gettext command.
109
111 This section describes briefly the common options provided by programs
112 using ocaml-gettext library.
113
114 --gettext-failsafe ignore
115 Defines the behaviour of ocaml-gettext regarding any error that
116 could be encountered during the processing of string transla‐
117 tion. ignore is the default behaviour. The string returned is
118 the original string untranslated. This behaviour is consistent
119 and allows to have a usable output, even if it is not perfect.
120
121 --gettext-failsafe inform-stderr
122 Same behaviour as ignore, except that a message is printed on
123 stderr,
124
125 --gettext-failsafe raise-exception
126 Stops the program by raising an exception when an error is en‐
127 countered.
128
129 --gettext-disable
130 Disables any translation made by ocaml-gettext. All transla‐
131 tions return the original string untranslated.
132
133 --gettext-domain-dir textdomain dir
134 Defines a dir to search for a specific domain. This could be
135 useful if MO files are stored in a non standard directory.
136
137 --gettext-dir dir
138 Adds a directory to search for MO files.
139
140 --gettext-language language
141 Sets the language to use in ocaml-gettext library. The language
142 should be POSIX compliant. The language should follow the fol‐
143 lowing convention: lang[_territory][.charset][@modifier]. The
144 lang and territory should be two letters ISO code. Charset
145 should be a valid ISO character set (at least recognised by the
146 underlying charset recoding routine). For example, valid lan‐
147 guages are: fr_FR.ISO-8859-1@euro, de_DE.UTF-8.
148
149 --gettext-codeset codeset
150 Sets the codeset for output.
151
152 Users should be aware that these command line options, apply only for
153 strings after the initialisation of the library. This means that if
154 the options initially guessed by ocaml-gettext don't match the command
155 line provided, there should be some untranslated string, because these
156 strings are translated before parsing options. This is particularly
157 true for the usage message itself (--help): even if the strings are
158 translated, they are translated before setting the correct option.
159
160 Some options (--gettext-codeset for example) are overrided internally
161 for particular use. It should be required to always translate strings
162 to UTF-8 in graphical user interface (because GTK2 requires it).
163
165 Options --uninstall-language, --uninstall-textdomain, --install-lan‐
166 guage and --install-textdomain could be guessed from the filename pro‐
167 vided. You must be aware that these options can conflict with the fact
168 that you provide several files to install. For example, if you provide
169 a textdomain, you should either install several MO files which file‐
170 names only reflect the language or only one MO file if you also provide
171 a language. For example, you can execute ocaml-gettext --in‐
172 stall-textdomain mytextdomain fr.po de.po without problem, but you can‐
173 not execute ocaml-gettext --install-textdomain mytextdomain --in‐
174 stall-language fr fr.po de.po . This restriction is due to the fact
175 that you should not over specified file installation.
176
177 Rules for guessing the language/textdomain are: language[.textdo‐
178 main].mo. For a full automated install without giving any hints,
179 through command line options, you should name your file fr.mytextdo‐
180 main.mo or de.mytextdomain.mo.
181
183 ocaml-xgettext(1), ocaml-gettext(5).
184
186 Sylvain Le Gall.
187
188
189
190 2008-04-29 OCAML-GETTEXT(1)