3 # Test of gettext facilities in the RST format.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles prog.rst"
10 # From the rstconv program itself.
11 rstconv.
help='rstconv [-h|--help] Displays this help'#10+
12 'rstconv options Convert rst file'#10#10+
14 ' -i file Use specified file instead of stdin as input .rst (OPTIONAL)'#10+
15 ' -o file Write output to specified file (REQUIRED)'#10+
16 ' -f format Specifies the output format:'#10+
17 ' po GNU gettext .po (portable) format (DEFAULT)'#10
19 rstconv.InvalidOption
='Invalid option - '
20 rstconv.OptionAlreadySpecified
='Option has already been specified - '
21 rstconv.NoOutFilename
='No output filename specified'
22 rstconv.InvalidOutputFormat
='Invalid output format -'
25 tmpfiles
="$tmpfiles prog.pot"
26 : ${XGETTEXT=xgettext}
27 ${XGETTEXT} -o prog.pot
--omit-header --add-location prog.rst
29 tmpfiles
="$tmpfiles prog.ok"
33 "rstconv [-h|--help] Displays this help\n"
34 "rstconv options Convert rst file\n"
37 " -i file Use specified file instead of stdin as input .rst (OPTIONAL)\n"
38 " -o file Write output to specified file (REQUIRED)\n"
39 " -f format Specifies the output format:\n"
40 " po GNU gettext .po (portable) format (DEFAULT)\n"
43 #: rstconv.InvalidOption
44 msgid "Invalid option - "
47 #: rstconv.OptionAlreadySpecified
48 msgid "Option has already been specified - "
51 #: rstconv.NoOutFilename
52 msgid "No output filename specified"
55 #: rstconv.InvalidOutputFormat
56 msgid "Invalid output format -"
61 ${DIFF} prog.ok prog.pot ||
exit 1
63 # The output of rstconv is slightly different:
64 # - ModuleName:ConstName instead of ModuleName.ConstName
66 # - extra newline at the end
68 tmpfiles
="$tmpfiles prog.pot"
70 if (${RSTCONV} -o prog.pot
-i prog.rst
) >/dev
/null
2>&1; then
72 tmpfiles
="$tmpfiles prog.ok"
75 msgid "rstconv [-h|--help] Displays this help\nrstconv options Convert rst file\n\nOptions are:\n -i file Use specified file instead of stdin as input .rst (OPTIONAL)\n -o file Write output to specified file (REQUIRED)\n -f format Specifies the output format:\n po GNU gettext .po (portable) format (DEFAULT)\n"
78 #: rstconv:InvalidOption
79 msgid "Invalid option - "
82 #: rstconv:OptionAlreadySpecified
83 msgid "Option has already been specified - "
86 #: rstconv:NoOutFilename
87 msgid "No output filename specified"
90 #: rstconv:InvalidOutputFormat
91 msgid "Invalid output format -"
97 ${DIFF} prog.ok prog.pot ||
exit 1