Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1968e9

Browse files
committed
Update docstrings for the script and make function
1 parent5fb1575 commitb1968e9

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 handleplural formsbut itdoeshandle message contexts.
9+
handlesplural formsand message contexts, butdoesnot 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
importos
@@ -95,6 +103,15 @@ def generate(messages):
95103

96104

97105
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+
"""
98115
messages= {}
99116
ifisinstance(filenames,str):
100117
infile,outfile=get_names(filenames,outfile)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp