Scroll to navigation

OCAML-GETTEXT(1) OCAML-GETTEXT(1)

NAME

ocaml-gettext - program to manage PO and MO files for OCaml sourcefiles.

SYNOPSIS

ocaml-gettext --action verb options* [file...]

DESCRIPTION

This manual page documents briefly the ocaml-gettext command.

Files provided are considered to be OCaml source files andocaml-gettext tries to extract translatable strings of it.The output of the command is a POT file.As a special case, if a file named POTFILES is in the list of the fileprovided, every line of it is considered as a file to be searched.
Files provided are considered to be PO file.These files are compiled in binary MO files,
Files provided are considered to be MO files.They are installed in their respective directories considering language,textdomain and category,
This is the symmetric command to install, but it uninstalls filesprovided for the considered language, textdomain and category,
Merges a POT file with the provided PO file.
Command to extract translatable strings from an OCaml source file.This command should output the same marshalled structure asocaml-xgettext.The best to do is to use the same build version of ocaml-gettext.
Default options used when extracting translatable strings.These options are camlp4 options and will be passed to ocaml-xgettextwhen processing files that don't already have specific camlp4options.
Specific filename camlp4 options.It is used when extracting strings from the specified filename.It overrides default camlp4 options.
POT file to write when extracting translatable strings.
MO file to write when compiling a PO file.If not provided, the output will be the name of the PO file with ".mo"extension.
Language to use when installing a MO file.
Category to use when installing a MO file.
Textdomain to use when installing a MO file.
Base directory to use when installing a MO file.
Language to use when uninstalling a MO file.
Category to use when uninstalling a MO file.
Textdomain to use when uninstalling a MO file.
Base directory used when uninstalling a MO file.
POT file to use as a master for merging PO file.
Backup extension to use when moving PO file which have been merged.
Return version information on ocaml-gettext.
Returns only the version of ocaml-gettext.The return is made to be easily parseable by configure script.The output of this command will always be the shortest version string,made of numeric characters (0-9) and ".".The version strings should be compared considering that a version A isgreater than a version B if there is a number between two "." of A thatis greater than B the corresponding number, beginning at the right ofthe string.For example: 0.14 is greater than 0.13.1.
Displays the help about the ocaml-gettext command.

OCAML-GETTEXTOPTIONS

This section describes briefly the common options provided by programsusing ocaml-gettext library.

Defines the behaviour of ocaml-gettext regarding any error that couldbe encountered during the processing of string translation.ignore is the default behaviour.The string returned is the original string untranslated.This behaviour is consistent and allows to have a usable output, even ifit is not perfect.
Same behaviour as ignore, except that a message is printed on stderr,
Stops the program by raising an exception when an error is encountered.
Disables any translation made by ocaml-gettext.All translations return the original string untranslated.
Defines a dir to search for a specific domain.This could be useful if MO files are stored in a non standard directory.
Adds a directory to search for MO files.
Sets the language to use in ocaml-gettext library.The language should be POSIX compliant.The language should follow the following convention:lang[_territory][.charset][@modifier].The lang and territory should be two letters ISO code.Charset should be a valid ISO character set (at least recognised by theunderlying charset recoding routine).For example, valid languages are: fr_FR.ISO-8859-1@euro,de_DE.UTF-8.
Sets the codeset for output.

Users should be aware that these command line options, apply only forstrings after the initialisation of the library.This means that if the options initially guessed by ocaml-gettextdon't match the command line provided, there should be someuntranslated string, because these strings are translated before parsingoptions.This is particularly true for the usage message itself (--help): evenif the strings are translated, they are translated before setting thecorrect option.

Some options (--gettext-codeset for example) are overrided internallyfor particular use.It should be required to always translate strings to UTF-8 in graphicaluser interface (because GTK2 requires it).

NOTES

Options --uninstall-language, --uninstall-textdomain,--install-language and --install-textdomain could be guessed fromthe filename provided.You must be aware that these options can conflict with the fact that youprovide several files to install.For example, if you provide a textdomain, you should either installseveral MO files which filenames only reflect the language or only oneMO file if you also provide a language.For example, you can execute ocaml-gettext --install-textdomainmytextdomain fr.po de.po without problem, but you cannot executeocaml-gettext --install-textdomain mytextdomain--install-language fr fr.po de.po .This restriction is due to the fact that you should not over specifiedfile installation.

Rules for guessing the language/textdomain are:language[.textdomain].mo.For a full automated install without giving any hints, through commandline options, you should name your file fr.mytextdomain.mo orde.mytextdomain.mo.

SEEALSO

ocaml-xgettext(1), ocaml-gettext(5).

AUTHORS

Sylvain Le Gall.

2008-04-29