1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of GSettings support.
5
6cat <<EOF > xg-gs-1-empty.gschema.xml
7<?xml version="1.0"?>
8<schemalist/>
9EOF
10
11: ${XGETTEXT=xgettext}
12${XGETTEXT} -o xg-gs-1.pot xg-gs-1-empty.gschema.xml 2>/dev/null
13test $? = 0 || {
14  echo "Skipping test: xgettext was built without GSettings support"
15  Exit 77
16}
17
18cat <<EOF > xg-gs-1.gschema.xml
19<?xml version="1.0"?>
20<schemalist>
21  <schema id="org.gnome.example" path="/org/gnome/example/">
22    <key name="foo" type="i">
23      <default>0</default>
24      <!-- This is the first line.
25           This is the second line. -->
26      <summary>Example Integer Key</summary>
27      <description>
28        The example integer key to test that the default value is not
29        translated.
30      </description>
31    </key>
32    <key name="bar" type="s">
33      <default l10n="messages" context="Foo">
34        ' foo   bar   baz'
35      </default>
36    </key>
37    <key name="baz" type="s">
38      <default l10n="messages" context="Baz"></default>
39      <summary context="Baz"></summary>
40    </key>
41  </schema>
42</schemalist>
43EOF
44
45: ${XGETTEXT=xgettext}
46${XGETTEXT} --add-comments -o xg-gs-1.tmp xg-gs-1.gschema.xml || Exit 1
47func_filter_POT_Creation_Date xg-gs-1.tmp xg-gs-1.pot
48
49cat <<EOF > xg-gs-1.ok
50# SOME DESCRIPTIVE TITLE.
51# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
52# This file is distributed under the same license as the PACKAGE package.
53# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
54#
55#, fuzzy
56msgid ""
57msgstr ""
58"Project-Id-Version: PACKAGE VERSION\n"
59"Report-Msgid-Bugs-To: \n"
60"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
61"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
62"Language-Team: LANGUAGE <LL@li.org>\n"
63"Language: \n"
64"MIME-Version: 1.0\n"
65"Content-Type: text/plain; charset=CHARSET\n"
66"Content-Transfer-Encoding: 8bit\n"
67
68#. This is the first line.
69#. This is the second line.
70#: xg-gs-1.gschema.xml:8
71msgid "Example Integer Key"
72msgstr ""
73
74#: xg-gs-1.gschema.xml:9
75msgid ""
76"The example integer key to test that the default value is not translated."
77msgstr ""
78
79#: xg-gs-1.gschema.xml:15
80msgctxt "Foo"
81msgid "' foo   bar   baz'"
82msgstr ""
83EOF
84
85: ${DIFF=diff}
86${DIFF} xg-gs-1.ok xg-gs-1.pot
87result=$?
88
89exit $result
90