• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of Ruby support.
5
6(rxgettext --version) >/dev/null 2>/dev/null \
7  || { echo "Skipping test: rxgettext not found"; Exit 77; }
8
9cat <<\EOF > xg-ru-1.rb
10_("abc")
11# Some comment.
12_("abc%%def")
13_("abc%{foo}def")
14# xgettext: no-ruby-format
15_("abc%{bar}def")
16_("some %d people")
17EOF
18
19: ${XGETTEXT=xgettext}
20${XGETTEXT} --add-comments --no-location -o xg-ru-1.tmp xg-ru-1.rb 2>xg-ru-1.err
21test $? = 0 || { cat xg-ru-1.err; Exit 1; }
22func_filter_POT_Creation_Date xg-ru-1.tmp xg-ru-1.pot
23
24cat <<\EOF > xg-ru-1.ok
25# SOME DESCRIPTIVE TITLE.
26# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
27# This file is distributed under the same license as the PACKAGE package.
28# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
29#
30#, fuzzy
31msgid ""
32msgstr ""
33"Project-Id-Version: PACKAGE VERSION\n"
34"Report-Msgid-Bugs-To: \n"
35"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
36"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
37"Language-Team: LANGUAGE <LL@li.org>\n"
38"Language: \n"
39"MIME-Version: 1.0\n"
40"Content-Type: text/plain; charset=UTF-8\n"
41"Content-Transfer-Encoding: 8bit\n"
42
43msgid "abc"
44msgstr ""
45
46#. Some comment.
47#, ruby-format
48msgid "abc%%def"
49msgstr ""
50
51#, ruby-format
52msgid "abc%{foo}def"
53msgstr ""
54
55#, no-ruby-format
56msgid "abc%{bar}def"
57msgstr ""
58
59#, ruby-format
60msgid "some %d people"
61msgstr ""
62EOF
63
64: ${DIFF=diff}
65${DIFF} xg-ru-1.ok xg-ru-1.pot
66result=$?
67
68exit $result
69