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">
27 <tool name="msgmerge">
30 This scons tool is a part of scons &t-link-gettext; toolset. It provides
31 scons interface to <command>msgmerge(1)</command> command, which merges two
32 Uniform style <filename>.po</filename> files together.
37 <item>MSGMERGECOM </item>
38 <item>MSGMERGECOMSTR</item>
39 <item>MSGMERGEFLAGS</item>
40 <item>POSUFFIX </item>
41 <item>POTSUFFIX</item>
42 <item>POUPDATE_ALIAS</item>
45 <item>POTDOMAIN</item>
46 <item>LINGUAS_FILE</item>
47 <item>POAUTOINIT</item>
51 <builder name="POUpdate">
54 The builder belongs to &t-link-msgmerge; tool. The builder updates
55 <literal>PO</literal> files with <command>msgmerge(1)</command>, or initializes
56 missing <literal>PO</literal> files as described in documentation of
57 &t-link-msginit; tool and &b-link-POInit; builder (see also
58 &cv-link-POAUTOINIT;). Note, that &b-POUpdate; <emphasis>does not add its
59 targets to <literal>po-create</literal> alias</emphasis> as &b-link-POInit;
64 Target nodes defined through &b-POUpdate; are not built by default
65 (they're <literal>Ignore</literal>d from <literal>'.'</literal> node). Instead,
66 they are added automatically to special <literal>Alias</literal>
67 (<literal>'po-update'</literal> by default). The alias name may be changed
68 through the &cv-link-POUPDATE_ALIAS; construction variable. You can easily
69 update <literal>PO</literal> files in your project by <command>scons
74 <emphasis>Example 1.</emphasis>
75 Update <filename>en.po</filename> and <filename>pl.po</filename> from
76 <filename>messages.pot</filename> template (see also &cv-link-POTDOMAIN;),
77 assuming that the later one exists or there is rule to build it (see
82 env.POUpdate(['en','pl']) # messages.pot --> [en.po, pl.po]
86 <emphasis>Example 2.</emphasis>
87 Update <filename>en.po</filename> and <filename>pl.po</filename> from
88 <filename>foo.pot</filename> template:
92 env.POUpdate(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.pl]
96 <emphasis>Example 3.</emphasis>
97 Update <filename>en.po</filename> and <filename>pl.po</filename> from
98 <filename>foo.pot</filename> (another version):
102 env.POUpdate(['en', 'pl'], POTDOMAIN='foo') # foo.pot -- > [en.po, pl.pl]
106 <emphasis>Example 4.</emphasis>
107 Update files for languages defined in <filename>LINGUAS</filename> file. The
108 files are updated from <filename>messages.pot</filename> template:
112 env.POUpdate(LINGUAS_FILE = 1) # needs 'LINGUAS' file
116 <emphasis>Example 5.</emphasis>
117 Same as above, but update from <filename>foo.pot</filename> template:
121 env.POUpdate(LINGUAS_FILE = 1, source = ['foo'])
125 <emphasis>Example 6.</emphasis>
126 Update <filename>en.po</filename> and <filename>pl.po</filename> plus files for
127 languages defined in <filename>LINGUAS</filename> file. The files are updated
128 from <filename>messages.pot</filename> template:
131 # produce 'en.po', 'pl.po' + files defined in 'LINGUAS':
132 env.POUpdate(['en', 'pl' ], LINGUAS_FILE = 1)
136 <emphasis>Example 7.</emphasis>
137 Use &cv-link-POAUTOINIT; to automatically initialize <literal>PO</literal> file
142 env.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1)
146 <emphasis>Example 8.</emphasis>
147 Update <literal>PO</literal> files for languages defined in
148 <filename>LINGUAS</filename> file. The files are updated from
149 <filename>foo.pot</filename> template. All necessary settings are
150 pre-configured via environment.
154 env['POAUTOINIT'] = 1
155 env['LINGUAS_FILE'] = 1
156 env['POTDOMAIN'] = 'foo'
163 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
164 <cvar name="POUPDATE_ALIAS">
167 Common alias for all <literal>PO</literal> files being defined with
168 &b-link-POUpdate; builder (default: <literal>'po-update'</literal>).
169 See &t-link-msgmerge; tool and &b-link-POUpdate; builder.
173 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
174 <cvar name="MSGMERGE">
177 Absolute path to <command>msgmerge(1)</command> binary as found by
178 <function>Detect()</function>.
179 See &t-link-msgmerge; tool and &b-link-POUpdate; builder.
183 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
184 <cvar name="MSGMERGECOM">
187 Complete command line to run <command>msgmerge(1)</command> command.
188 See &t-link-msgmerge; tool and &b-link-POUpdate; builder.
192 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
193 <cvar name="MSGMERGECOMSTR">
196 String to be displayed when <command>msgmerge(1)</command> is invoked
197 (default: <literal>''</literal>, which means ``print &cv-link-MSGMERGECOM;'').
198 See &t-link-msgmerge; tool and &b-link-POUpdate; builder.
202 <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
203 <cvar name="MSGMERGEFLAGS">
206 Additional flags to <command>msgmerge(1)</command> command.
207 See &t-link-msgmerge; tool and &b-link-POUpdate; builder.