• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of Tcl support.
5
6cat <<\EOF > xg-t-1.tcl
7#!/usr/bin/tclsh
8
9proc isValid {target} {
10	global viScreenId
11	set address [valid $target]
12	# This comment is not extracted.
13	if {$address != 0} {
14		# First comment line.
15
16		# Second comment line.
17		viMsg $viScreenId [format [_ "%s is %s"] $target [string trim $address]]
18	} else {
19		viMsg $viScreenId [format [_ "%s not found"] $target]
20	}
21}
22EOF
23
24: ${XGETTEXT=xgettext}
25${XGETTEXT} --add-comments --no-location -k_ -o xg-t-1.tmp xg-t-1.tcl 2>xg-t-1.err
26test $? = 0 || { cat xg-t-1.err; Exit 1; }
27func_filter_POT_Creation_Date xg-t-1.tmp xg-t-1.pot
28
29cat <<\EOF > xg-t-1.ok
30# SOME DESCRIPTIVE TITLE.
31# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
32# This file is distributed under the same license as the PACKAGE package.
33# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
34#
35#, fuzzy
36msgid ""
37msgstr ""
38"Project-Id-Version: PACKAGE VERSION\n"
39"Report-Msgid-Bugs-To: \n"
40"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
41"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
42"Language-Team: LANGUAGE <LL@li.org>\n"
43"Language: \n"
44"MIME-Version: 1.0\n"
45"Content-Type: text/plain; charset=CHARSET\n"
46"Content-Transfer-Encoding: 8bit\n"
47
48#. First comment line.
49#. Second comment line.
50#, tcl-format
51msgid "%s is %s"
52msgstr ""
53
54#, tcl-format
55msgid "%s not found"
56msgstr ""
57EOF
58
59: ${DIFF=diff}
60${DIFF} xg-t-1.ok xg-t-1.pot
61result=$?
62
63exit $result
64