Skip to content

Commit b1968e9

Browse files
committed
Update docstrings for the script and make function
1 parent 5fb1575 commit b1968e9

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

Tools/i18n/msgfmt.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
This program converts a textual Uniforum-style message catalog (.po file) into
77
a binary GNU catalog (.mo file). This is essentially the same function as the
88
GNU msgfmt program, however, it is a simpler implementation. Currently it
9-
does not handle plural forms but it does handle message contexts.
9+
handles plural forms and message contexts, but does not generate hash table.
1010
11-
Usage: msgfmt.py [OPTIONS] filename.po
11+
Usage: msgfmt.py [OPTIONS] filename.po [filename.po ...]
1212
1313
Options:
1414
-o file
@@ -23,6 +23,14 @@
2323
-V
2424
--version
2525
Display version information and exit.
26+
27+
If more than one input file is given, and if an output file is passed with
28+
-o option, then all the input files are merged. If keys are repeated (common
29+
for "" key for the header) the one from last file is used.
30+
31+
If more than one input file is given, and no -o option is present, then
32+
every input file is compiled in its corresponding mo file (same name with mo
33+
replacing po)
2634
"""
2735

2836
import os
@@ -95,6 +103,15 @@ def generate(messages):
95103

96104

97105
def make(filenames, outfile):
106+
"""This function is now member of the public interface.
107+
filenames is a string or an iterable of strings representing input file(s)
108+
outfile is a string for the name of an input file or None.
109+
110+
If it is not None, the output file receives a merge of the input files
111+
If it is None, then each input file is separately compiled into its
112+
corresponding output file (same name with po replaced with mo).
113+
Both ways are for compatibility reasons with previous behaviour.
114+
"""
98115
messages = {}
99116
if isinstance(filenames, str):
100117
infile, outfile = get_names(filenames, outfile)

0 commit comments

Comments
 (0)