package gettext

  1. Overview
  2. Docs

Functions for extraction/compilation/installation of PO/MO file.

  • author Sylvain Le Gall
val po_of_filename : GettextTypes.filename -> GettextTypes.po_content
val extract : string -> string -> string GettextTypes.MapString.t -> GettextTypes.MapString.key list -> string -> unit

extract cmd default_option file_options src_files ppf : extract the translatable strings from all the src_files provided. Each source file will be extracted using the command cmd, which should be an executable that has the same output as ocaml-xgettext. If cmd is not provided, it will be searched in the current path. The command will be called with default_option, or if the file being extracted is mapped in file_options, with the option associated to the filename in file_options. The result will be written using module Format to the formatter ppf. The result of the extraction should be used as a po template file.

val compile : GettextTypes.filename -> FilePath.filename -> unit

compile input_po output_mo : create a binary representation of the PO file provided as input_pot. The output file is output_mo.

val install : bool -> string -> string -> GettextCategory.category -> string -> FilePath.filename -> unit

install destdir language category textdomain fln : copy the given filename ( should be a MO file ) to the filename defined by all the other parameters ( typically destdir/language/category/textdomain.mo ).

val uninstall : string -> string -> GettextCategory.category -> string -> unit

uninstall orgdir language category textdomain : remove the MO file defined by all the other parameters ( typically destdir/language/category/textdomain.mo ).

val merge : GettextTypes.filename -> GettextTypes.filename list -> string -> unit

merge fln_pot fln_po_lst backup_ext : use fln_pot as a POT file and merge the current content of the listed PO file ( fln_po_lst ) with it. Backup all the PO file using the provided backup extension backup_ext and produce a merged PO file in place.