module Simple_gettext:Internationalisation of your program / librarysig..end
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 domainnameval textdomain : string -> unit
val i18n : ('a, unit, string) Pervasives.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 programval 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