Return-Path: <pdontthink@angrynerds.com>
Received: from muffin ([unix socket])
	by muffin (Cyrus v2.1.13) with LMTP; Tue, 14 Oct 2003 14:04:29 -0400
X-Sieve: CMU Sieve 2.2
Return-Path: <pdontthink@angrynerds.com>
Received: from patiencehosting.net (unknown [216.65.63.39])
	by muffin.linuxnotes.net (Postfix) with ESMTP id 9C71024122
	for <quincy@linuxnotes.net>; Tue, 14 Oct 2003 14:04:29 -0400 (EDT)
Received: from tora (adsl-66-127-56-44.dsl.snfc21.pacbell.net [66.127.56.44])
	by patiencehosting.net (Postfix) with ESMTP id 62C8733183
	for <quincy@linuxnotes.net>; Tue, 14 Oct 2003 11:02:28 -0700 (PDT)
From: "p dont think" <pdontthink@angrynerds.com>
To: <quincy@linuxnotes.net>
Subject: RE: abook_group il8n
Date: Tue, 14 Oct 2003 11:04:06 -0700
Message-ID: <000e01c3927d$916e2d30$c800a8c0@tora>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.3416
Importance: Normal
In-Reply-To: <43555.164.156.136.160.1065707879.squirrel@linuxnotes.net>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

> I hope you don't mind me contacting you off list, but I have a newbie
> question that I hope you can help me with.

No problem, sorry for the delay; I was out of town for the weekend.

> I have found that if I wrap large chunks of code in bindtextdomain()
for
> example:
> 
>     bindtextdomain('abook_group', SM_PATH .
'plugins/abook_group/locale');
>     textdomain('abook_group');
> 
>         /* A lot of code */
> 
>     bindtextdomain('squirrelmail', SM_PATH . 'locale');
>     textdomain('squirrelmail');
> 
> the translation does not work.  If I just wrap the echo statements it
works.

The problem is not that all the output needs to be in echo statements
(the php processor essentially changes all that stuff into one big echo
statement anyway), but that any strings that you need to have translated
*must* be wrapped in those special delimiters:  _("...")   

That means that the HTML is OK, but every translatable string does need
to be in an echo statement, such as:

// some php code
if ($x == 'blah')
{
   // some html with a translation needed in the middle
   ?>
      <h3><font color=red><?php echo _("BLAH") ?></font></h3>
   <?php
}

Technically, having separate HTML code sections is the faster way to
code, rather than putting long sections of HTML (especially if they are
static) inside echo statements, so just interjecting echo ("...") inside
of the HTML should be fine.

HTH,

  Paul



