module Simple_gettext:sig..end
Internationalisation of your program / library
Typical use:
open Simple_gettext
...
Simple_gettext.textdomain "mathplot";
...
print_endline (i18n "Hello %s!" name);
Then use xgettext-ocaml -o foo.pot *.ml
More information: overview of gettext
Why did you develop yet another gettext binding? Why not use the existing gettext binding (OCamlGettext)?
OCamlGettext is:
val bindtextdomain : string -> string -> unitbindtextdomain domainname dirname tells to use directory dirname to look for translations for domainname
val textdomain : string -> unittextdomain domainname sets current domain used by Simple_gettext.gettext
val i18n : ('a, unit, string) Stdlib.format -> 'ai18n msgid args returns the string msgid translated using current domain (set using Simple_gettext.textdomain)
val i18n_ : string -> stringi18n_ msgid returns the string verbatim. Useful for messages translated later (using Simple_gettext.gettext or Simple_gettext.dgettext) in the program
val gettext : string -> stringgettext msgid returns the string msgid translated using the current domain (set using Simple_gettext.textdomain)
val dgettext : string -> string -> stringdgettext domainname msgid returns the string msgid translated using domainname