<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--==================================================================
ocaml-gettext: a library to translate messages
Copyright (C) 2003-2008 Sylvain Le Gall <sylvain@le-gall.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version;
with the OCaml static compilation exception.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
===================================================================-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"/usr/share/xml/schema/dtd/4.3/docbookx.dtd" [
]>
<refentry>
<refentryinfo>
<productname>ocaml-gettext</productname>
<productnumber/>
<date>2008-04-29</date>
</refentryinfo>
<refmeta>
<refentrytitle>OCAML-GETTEXT</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname><command>ocaml-gettext</command></refname>
<refpurpose>program to manage PO and MO files for OCaml source files.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>ocaml-gettext</command>
<arg choice="plain">--action
<sbr/>
<group>
<arg choice="plain">extract</arg>
<arg choice="plain">compile</arg>
<arg choice="plain">install</arg>
<arg choice="plain">uninstall</arg>
<arg choice="plain">merge</arg>
</group>
</arg>
<sbr/>
<arg choice="opt">--extract-command <arg choice="req"><replaceable>cmd</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--extract-default-option <arg choice="req"><replaceable>options</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--extract-filename-option <arg choice="req"><replaceable>filename</replaceable></arg>
<arg choice="req"><replaceable>options</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--extract-pot <arg choice="req"><replaceable>filename</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--compile-output <arg choice="req"><replaceable>filename</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--install-language <arg choice="req"><replaceable>language</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--install-category <arg choice="req"><replaceable>category</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--install-textdomain <arg choice="req"><replaceable>textdomain</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--install-destdir <arg choice="req"><replaceable>dirname</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--uninstall-language <arg choice="req"><replaceable>language</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--uninstall-category <arg choice="req"><replaceable>category</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--uninstall-textdomain <arg choice="req"><replaceable>textdomain</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--uninstall-orgdir <arg choice="req"><replaceable>dirname</replaceable></arg></arg>
<sbr/>
<arg choice="req">--merge-pot <arg choice="req"><replaceable>filename</replaceable></arg></arg>
<sbr/>
<arg choice="opt">--merge-backup-extension <arg choice="req"><replaceable>extension</replaceable></arg></arg>
<sbr/>
<!-- The ocaml-gettext standard options -->
<xi:include
href="ocaml-gettext-options.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xpointer="xpointer(id('ocaml-gettext-options-cmdsynopsis')/node())"/>
<group>
<arg choice="plain">--version</arg>
<arg choice="plain">--short-version</arg>
<arg choice="plain">-help</arg>
<arg choice="plain">--help</arg>
</group>
<sbr/>
<arg rep="repeat">file</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>
This manual page documents briefly the <command>ocaml-gettext</command> command.
</para>
<variablelist>
<varlistentry>
<term>
<option>--action <parameter>extract</parameter></option>
</term>
<listitem>
<para>
Files provided are considered to be OCaml source files and <command>ocaml-gettext</command>
tries to extract translatable strings of it. The output of the command is a POT file. As a
special case, if a file named <filename>POTFILES</filename> is in the list of the file
provided, every line of it is considered as a file to be searched.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--action <parameter>compile</parameter></option>
</term>
<listitem>
<para>
Files provided are considered to be PO file. These files are compiled in binary
MO files,
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--action <parameter>install</parameter></option>
</term>
<listitem>
<para>
Files provided are considered to be MO files. They are installed in their
respective directories considering language, textdomain and category,
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--action <parameter>uninstall</parameter></option>
</term>
<listitem>
<para>
This is the symmetric command to <option>install</option>, but it uninstalls files provided for the considered
language, textdomain and category,
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--action <parameter>merge</parameter></option>
</term>
<listitem>
<para>
Merges a POT file with the provided PO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--extract-command <parameter>cmd</parameter></option>
</term>
<listitem>
<para>
Command to extract translatable strings from an OCaml source file. This command should output
the same marshalled structure as <command>ocaml-xgettext</command>. The best to do is to use the same
build version of <command>ocaml-gettext</command>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--extract-default-option <parameter>options</parameter></option>
</term>
<listitem>
<para>
Default options used when extracting translatable strings. These options are <command>camlp4</command> options and
will be passed to <command>ocaml-xgettext</command> when processing files that don't already have specific
<command>camlp4</command> options.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--extract-filename-option <parameter>filename</parameter> <parameter>options</parameter></option>
</term>
<listitem>
<para>
Specific filename <command>camlp4</command> options. It is used when extracting strings from the specified filename. It
overrides default <command>camlp4</command> options.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--extract-pot <parameter>filename</parameter></option>
</term>
<listitem>
<para>
POT file to write when extracting translatable strings.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--compile-output <parameter>filename</parameter></option>
</term>
<listitem>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--install-language <parameter>language</parameter></option>
</term>
<listitem>
<para>
Language to use when installing a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--install-category <parameter>category</parameter></option>
</term>
<listitem>
<para>
Category to use when installing a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--install-textdomain <parameter>textdomain</parameter></option>
</term>
<listitem>
<para>
Textdomain to use when installing a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--install-destdir <parameter>dirname</parameter></option>
</term>
<listitem>
<para>
Base directory to use when installing a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--uninstall-language <parameter>language</parameter></option>
</term>
<listitem>
<para>
Language to use when uninstalling a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--uninstall-category <parameter>category</parameter></option>
</term>
<listitem>
<para>
Category to use when uninstalling a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--uninstall-textdomain <parameter>textdomain</parameter></option>
</term>
<listitem>
<para>
Textdomain to use when uninstalling a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--uninstall-orgdir <parameter>dirname</parameter></option>
</term>
<listitem>
<para>
Base directory used when uninstalling a MO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--merge-pot <parameter>filename</parameter></option>
</term>
<listitem>
<para>
POT file to use as a master for merging PO file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--merge-backup-extension <parameter>extension</parameter></option>
</term>
<listitem>
<para>
Backup extension to use when moving PO file which have been merged.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--version</option>
</term>
<listitem>
<para>
Return version information on ocaml-gettext.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--short-version</option>
</term>
<listitem>
<para>
Returns only the version of ocaml-gettext. The return is made to be easily parseable by <command>configure</command>
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 is greater than a version B if there is a
number between two "." of A that is greater than B the corresponding number, beginning at the right of the string.
For example: 0.14 is greater than 0.13.1.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-help</option>
</term>
<term>
<option>--help</option>
</term>
<listitem>
<para>
Displays the help about the <command>ocaml-gettext</command> command.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<xi:include
href="ocaml-gettext-options.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xpointer="xpointer(id('ocaml-gettext-options-description')/node())" />
</refsect1>
<refsect1>
<title>NOTES</title>
<para>
Options <option>--uninstall-language</option>, <option>--uninstall-textdomain</option>,
<option>--install-language</option> and <option>--install-textdomain</option> could be
guessed from the filename provided. You must be aware that these options can conflict with the fact that you
provide several files to install. For example, if you provide a textdomain, you should either install several
MO files which filenames only reflect the language or only one MO file if you also provide a language. For
example, you can execute
<command>ocaml-gettext
<option>--install-textdomain <parameter>mytextdomain</parameter></option>
<parameter><filename>fr.po</filename></parameter>
<parameter><filename>de.po</filename></parameter>
</command>
without problem, but you cannot execute
<command>ocaml-gettext
<option>--install-textdomain <parameter>mytextdomain</parameter></option>
<option>--install-language <parameter>fr</parameter></option>
<parameter><filename>fr.po</filename></parameter>
<parameter><filename>de.po</filename></parameter>
</command>. This restriction is due to the fact that you should not over specified file installation.
</para>
<para>
Rules for guessing the language/textdomain are: language[.textdomain].mo. For a full automated install
without giving any hints, through command line options, you should name your file
<filename>fr.mytextdomain.mo</filename> or <filename>de.mytextdomain.mo</filename>.
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle><command>ocaml-xgettext</command></refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry>
</para>
<para>
<citerefentry>
<refentrytitle>ocaml-gettext</refentrytitle>
<manvolnum>5</manvolnum>
</citerefentry>
</para>
</refsect1>
</refentry>