• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C support: extraction of 'range:' flags.
5
6cat <<\EOF > xg-c-6.c
7if (days > 7 && days < 14)
8  /* xgettext: range: 1..6 */
9  printf (ngettext ("one week and one day", "one week and %d days",
10                    days - 7),
11          days - 7);
12EOF
13
14: ${XGETTEXT=xgettext}
15${XGETTEXT} --omit-header --no-location -d xg-c-6.tmp xg-c-6.c || Exit 1
16LC_ALL=C tr -d '\r' < xg-c-6.tmp.po > xg-c-6.po || Exit 1
17
18cat <<EOF > xg-c-6.ok
19#, c-format, range: 1..6
20msgid "one week and one day"
21msgid_plural "one week and %d days"
22msgstr[0] ""
23msgstr[1] ""
24EOF
25
26: ${DIFF=diff}
27${DIFF} xg-c-6.ok xg-c-6.po
28result=$?
29
30exit $result
31