• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C++ support: test kde-format and format recognition heuristics.
5
6cat <<\EOF > xg-c-format-4.cc
7/* When xgettext has no info, it flags both c-format and kde-format, based
8   on the heuristics.  */
9gettext ("used time: %1m %2s");
10
11/* When the programmer says it's kde-format, xgettext does not apply the
12   heuristics.  */
13/* xgettext: kde-format */
14gettext ("remaining time: %1m %2s");
15EOF
16
17: ${XGETTEXT=xgettext}
18${XGETTEXT} --omit-header --no-location -d xg-c-format-4.tmp --language=C++ --kde \
19  xg-c-format-4.cc || Exit 1
20LC_ALL=C tr -d '\r' < xg-c-format-4.tmp.po > xg-c-format-4.po || Exit 1
21
22cat <<EOF > xg-c-format-4.ok
23#, c-format, kde-format
24msgid "used time: %1m %2s"
25msgstr ""
26
27#, kde-format
28msgid "remaining time: %1m %2s"
29msgstr ""
30EOF
31
32: ${DIFF=diff}
33${DIFF} xg-c-format-4.ok xg-c-format-4.po
34result=$?
35
36exit $result
37