• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test YCP support: --add-comments option.
5
6cat <<EOF > xg-y-2.ycp
7// This comment will not be extracted.
8print (_("help"));
9//  TRANSLATORS: This is an extracted comment.
10print (_("me"));
11# TRANSLATORS: This is extracted too.
12print (_("and you"));
13/* Not extracted either. */
14print (_("Hey Jude"));
15/*  TRANSLATORS:
16     Nickname of the Beatles
17*/
18print (_("The Fabulous Four"));
19EOF
20
21: ${XGETTEXT=xgettext}
22${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
23  -d xg-y-2.tmp xg-y-2.ycp || Exit 1
24LC_ALL=C tr -d '\r' < xg-y-2.tmp.po > xg-y-2.po || Exit 1
25
26cat <<EOF > xg-y-2.ok
27msgid "help"
28msgstr ""
29
30#. TRANSLATORS: This is an extracted comment.
31msgid "me"
32msgstr ""
33
34#. TRANSLATORS: This is extracted too.
35msgid "and you"
36msgstr ""
37
38msgid "Hey Jude"
39msgstr ""
40
41#. TRANSLATORS:
42#. Nickname of the Beatles
43#.
44msgid "The Fabulous Four"
45msgstr ""
46EOF
47
48: ${DIFF=diff}
49${DIFF} xg-y-2.ok xg-y-2.po
50result=$?
51
52exit $result
53