2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test 'bulk' mode of Desktop Entry support.
6 cat <<\EOF > mf.desktop
11 Comment[foo]=Already translated comment
12 Comment= \sThis is a \nmultiline comment; for testing
13 # This is a comment and must be preserved
14 Keywords=Keyword1;Keyword2;Key\;word3;
17 test -d po || mkdir po
20 # SOME DESCRIPTIVE TITLE.
21 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
22 # This file is distributed under the same license as the PACKAGE package.
23 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
28 "Project-Id-Version: PACKAGE VERSION\n"
29 "Report-Msgid-Bugs-To: \n"
30 "POT-Creation-Date: 2014-03-17 07:36+0900\n"
31 "PO-Revision-Date: 2014-03-17 08:40+0900\n"
32 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
33 "Language-Team: LANGUAGE <LL@li.org>\n"
36 "Content-Type: text/plain; charset=UTF-8\n"
37 "Content-Transfer-Encoding: 8bit\n"
48 "multiline comment; for testing"
54 msgid "Keyword1;Keyword2;Key\\;word3;"
55 msgstr "one;two;thr\\;ee;"
59 # SOME DESCRIPTIVE TITLE.
60 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
61 # This file is distributed under the same license as the PACKAGE package.
62 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
67 "Project-Id-Version: PACKAGE VERSION\n"
68 "Report-Msgid-Bugs-To: \n"
69 "POT-Creation-Date: 2014-03-17 07:36+0900\n"
70 "PO-Revision-Date: 2014-03-17 08:40+0900\n"
71 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
72 "Language-Team: LANGUAGE <LL@li.org>\n"
75 "Content-Type: text/plain; charset=UTF-8\n"
76 "Content-Transfer-Encoding: 8bit\n"
87 "multiline comment; for testing"
93 msgid "Keyword1;Keyword2;Key\\;word3;"
94 msgstr "one;two;thr\\;ee;"
97 cat <<\EOF > mf.desktop.ok
104 Comment[foo]=Already translated comment
105 Comment[de]=German \ncomment
106 Comment[fr]=French \ncomment
107 Comment=\sThis is a \nmultiline comment; for testing
108 # This is a comment and must be preserved
109 Keywords[de]=one;two;thr\;ee;
110 Keywords[fr]=one;two;thr\;ee;
111 Keywords=Keyword1;Keyword2;Key\;word3;
114 cat <<\EOF > mf.desktop.desired.ok
120 Comment[foo]=Already translated comment
121 Comment[fr]=French \ncomment
122 Comment=\sThis is a \nmultiline comment; for testing
123 # This is a comment and must be preserved
124 Keywords[fr]=one;two;thr\;ee;
125 Keywords=Keyword1;Keyword2;Key\;word3;
130 # Sanity checks for contradicting options.
132 ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.out \
133 >/dev/null 2>/dev/null \
136 test -d po/LINGUAS || mkdir po/LINGUAS
138 ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.out \
139 >/dev/null 2>/dev/null \
144 cat <<\EOF > po/LINGUAS
149 ${MSGFMT} --desktop --template=mf.desktop -d po \
150 >/dev/null 2>/dev/null \
153 ${MSGFMG} --desktop --template=mf.desktop -d po -o mf.desktop.out -l fr \
154 >/dev/null 2>/dev/null \
157 ${MSGFMG} --desktop --template=mf.desktop -d po -o mf.desktop.out po/fr.po \
158 >/dev/null 2>/dev/null \
161 # Proceed to the .desktop file generation.
163 ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.out || exit 1
166 ${DIFF} mf.desktop.ok mf.desktop.out
167 test $? = 0 || exit 1
169 # Restrict the desired languages with the LINGUAS envvar.
171 LINGUAS="fr ja" ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.desired.out || exit 1
174 ${DIFF} mf.desktop.desired.ok mf.desktop.desired.out
175 test $? = 0 || exit 1