manpagez: man pages & more
info gettext
Home | html | info | man

File: gettext.info,  Node: OCaml,  Next: Smalltalk,  Prev: D,  Up: List of Programming Languages

16.5.22 OCaml
-------------

RPMs
     ocaml, ocaml-gettext-devel

Ubuntu packages
     ocaml, opam
     ‘opam install gettext-stub’

File extension
     ‘ml’

String syntax
     ‘"abc"’

gettext shorthand
     ‘(s_ "abc")’ or, for format strings, ‘(f_ "abc")’

gettext/ngettext functions
     ‘s_’, ‘f_’, ‘sn_’, ‘fn_’, and also ‘gettext’, ‘fgettext’,
     ‘dgettext’, ‘fdgettext’, ‘dcgettext’, ‘fdcgettext’, ‘ngettext’,
     ‘fngettext’, ‘dngettext’, ‘fdngettext’, ‘dcngettext’,
     ‘fdcngettext’.

textdomain
     ‘textdomain’ field in first parameter of ‘Gettext.Program’

bindtextdomain
     ‘dir’ field in first parameter of ‘Gettext.Program’

setlocale
     --

Prerequisite
     Declare the libraries ‘gettext.base’ and ‘gettext-stub’ in the
     ‘dune’ file.

Use or emulate GNU gettext
     Use (assuming that you pass ‘GettextStub.Native’ as second
     parameter of ‘Gettext.Program’)

Extractor
     ‘xgettext’

Formatting with positions
     In the source code: ‘Printf.fprintf "%d %d"’
     In the msgid: ‘"%d %d"’
     In the msgstr: ‘"%2$d %1$d"’
     Note: This does not work yet; it depends on the completion of
     .

Portability
     fully portable

po-mode marking
     --

   An example is available in the ‘examples’ directory: ‘hello-ocaml’.

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.