3 SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4 SPDX-License-Identifier: MIT
5 SPDX-FileType: DOCUMENTATION
7 This file is processed by the bin/SConsDoc.py module.
11 <!ENTITY % scons SYSTEM '../../doc/scons.mod'>
13 <!ENTITY % builders-mod SYSTEM '../../doc/generated/builders.mod'>
15 <!ENTITY % functions-mod SYSTEM '../../doc/generated/functions.mod'>
17 <!ENTITY % tools-mod SYSTEM '../../doc/generated/tools.mod'>
19 <!ENTITY % variables-mod SYSTEM '../../doc/generated/variables.mod'>
23 <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
24 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25 xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
30 This tool is a part of the &t-link-gettext; toolset.
32 an interface to the <command>msgfmt(1)</command> command
33 by setting up the &b-link-MOFiles; builder,
34 which generates binary message catalog (<literal>MO</literal>) files
35 from a textual translation description
36 (<literal>PO</literal> files).
42 <item>MSGFMTCOM</item>
43 <item>MSGFMTCOMSTR</item>
44 <item>MSGFMTFLAGS</item>
48 <item>LINGUAS_FILE</item>
52 <builder name="MOFiles">
55 This builder is set up by the &t-link-msgfmt; tool.
57 <literal>PO</literal> files to <literal>MO</literal> files.
58 &b-MOFiles; is a single-source builder.
59 The <parameter>source</parameter> parameter
60 can also be omitted if &cv-link-LINGUAS_FILE; is set.
64 <emphasis>Example 1</emphasis>.
65 Create <filename>pl.mo</filename> and <filename>en.mo</filename> by compiling
66 <filename>pl.po</filename> and <filename>en.po</filename>:
68 <programlisting language="python">
69 env.MOFiles(['pl', 'en'])
73 <emphasis>Example 2</emphasis>.
74 Compile files for languages defined in <filename>LINGUAS</filename> file:
76 <programlisting language="python">
77 env.MOFiles(LINGUAS_FILE=True)
81 <emphasis>Example 3</emphasis>.
82 Create <filename>pl.mo</filename> and <filename>en.mo</filename> by compiling
83 <filename>pl.po</filename> and <filename>en.po</filename> plus files for
84 languages defined in <filename>LINGUAS</filename> file:
86 <programlisting language="python">
87 env.MOFiles(['pl', 'en'], LINGUAS_FILE=True)
91 <emphasis>Example 4</emphasis>.
92 Compile files for languages defined in <filename>LINGUAS</filename> file
95 <programlisting language="python">
96 env['LINGUAS_FILE'] = True
102 <cvar name="MOSUFFIX">
105 Suffix used for <literal>MO</literal> files (default: <literal>'.mo'</literal>).
106 See &t-link-msgfmt; tool and &b-link-MOFiles; builder.
114 Absolute path to <command>msgfmt(1)</command> binary, found by
115 <function>Detect()</function>.
116 See &t-link-msgfmt; tool and &b-link-MOFiles; builder.
121 <cvar name="MSGFMTCOM">
124 Complete command line to run <command>msgfmt(1)</command> program.
125 See &t-link-msgfmt; tool and &b-link-MOFiles; builder.
130 <cvar name="MSGFMTCOMSTR">
133 String to display when <command>msgfmt(1)</command> is invoked
134 (default: <literal>''</literal>, which means ``print &cv-link-MSGFMTCOM;'').
135 See &t-link-msgfmt; tool and &b-link-MOFiles; builder.
140 <cvar name="MSGFMTFLAGS">
143 Additional flags to <command>msgfmt(1)</command>.
144 See &t-link-msgfmt; tool and &b-link-MOFiles; builder.