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