|
6 | 6 | This program converts a textual Uniforum-style message catalog (.po file) into
|
7 | 7 | a binary GNU catalog (.mo file). This is essentially the same function as the
|
8 | 8 | GNU msgfmt program, however, it is a simpler implementation. Currently it
|
9 |
| -does not handleplural formsbut itdoeshandle message contexts. |
| 9 | +handlesplural formsand message contexts, butdoesnot generate hash table. |
10 | 10 |
|
11 |
| -Usage: msgfmt.py [OPTIONS] filename.po |
| 11 | +Usage: msgfmt.py [OPTIONS] filename.po [filename.po ...] |
12 | 12 |
|
13 | 13 | Options:
|
14 | 14 | -o file
|
|
23 | 23 | -V
|
24 | 24 | --version
|
25 | 25 | 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) |
26 | 34 | """
|
27 | 35 |
|
28 | 36 | importos
|
@@ -95,6 +103,15 @@ def generate(messages):
|
95 | 103 |
|
96 | 104 |
|
97 | 105 | defmake(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 | + """ |
98 | 115 | messages= {}
|
99 | 116 | ifisinstance(filenames,str):
|
100 | 117 | infile,outfile=get_names(filenames,outfile)
|
|