gettext textdomain foo?

Rudi Benkovič rudib@email.si
Tue, 8 Jan 2002 21:31:48 +0100


Hi,

While translating the Horde framework, I noticed something a bit weird from
the coders perspective:

In IMP, the preferences UI (prefs.php) includes several templates from the
Horde install, like this:

      include $registry->getTemplatePath("horde") . '/prefs/end.inc';

Now, the gettext textdomain at that time is set to 'imp', so that gettext
strings should be looked up in IMP's gettext files - but they aren't.
Actually, it looks up for translation from every application - you can even
put a Turba message into Horde's directory of templates with a line like this:

    print _("Home Phone");

...include it from IMP, and it will still get translated correctly! While this
is the right way and everything, I can't find this (hidden feature? :)
documented in the gettext or PHP docs... So, what is it? ;)

--

Rudi



>From jan@horde.org Date: Wed,  9 Jan 2002 00:28:23 +0100
Return-Path: <jan@horde.org>
Mailing-List: contact dev-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list dev@lists.horde.org
Received: (qmail 19602 invoked from network); 8 Jan 2002 23:32:52 -0000
Received: from mailout01.sul.t-online.com (194.25.134.80)
  by clark.horde.org with SMTP; 8 Jan 2002 23:32:51 -0000
Received: from fwd07.sul.t-online.de 
	by mailout01.sul.t-online.de with smtp 
	id 16O5hk-0003WO-01; Wed, 09 Jan 2002 00:30:52 +0100
Received: from linux.wg.de (320034214675-0001@[217.225.46.67]) by fmrl07.sul.t-online.com
	with esmtp id 16O5hi-1Gif3YC; Wed, 9 Jan 2002 00:30:50 +0100
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id g08NSN927968
	for <dev@lists.horde.org>; Wed, 9 Jan 2002 00:28:24 +0100
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@linux by linux.wg.de with HTTP;
	Wed,  9 Jan 2002 00:28:23 +0100
Message-ID: <1010532503.3c3b809711e8c@linux.wg.de>
Date: Wed,  9 Jan 2002 00:28:23 +0100
From: Jan Schneider <jan@horde.org>
To: dev@lists.horde.org
References: <20020107114919.885DC47C@arkady.horde.org> <1010515647.3c3b3ebf0f0c9@marina.horde.org>
In-Reply-To: <1010515647.3c3b3ebf0f0c9@marina.horde.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Re: [dev] Re: [cvs] cvs commit: imp compose.php

Zitat von Chuck Hagenbuch <chuck@horde.org>:

> Quoting Jan Schneider <jan@ammma.de>:
> 
> >   Why not check if the folder exists already before creating it?
> 
> Doesn't IMP_Folder::create() already call exists() first?

Yes, but it throws an error message each time. Not so nice if this happens 
every time you save a sent mail. :-)

Jan.

--
::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::


>From jan@horde.org Date: Wed,  9 Jan 2002 00:31:18 +0100
Return-Path: <jan@horde.org>
Mailing-List: contact dev-help@lists.horde.org; run by ezmlm
Delivered-To: mailing list dev@lists.horde.org
Received: (qmail 20161 invoked from network); 8 Jan 2002 23:41:08 -0000
Received: from mailout08.sul.t-online.com (194.25.134.20)
  by clark.horde.org with SMTP; 8 Jan 2002 23:41:08 -0000
Received: from fwd01.sul.t-online.de 
	by mailout08.sul.t-online.de with smtp 
	id 16O5rf-0007dQ-02; Wed, 09 Jan 2002 00:41:07 +0100
Received: from linux.wg.de (320034214675-0001@[217.225.46.67]) by fmrl01.sul.t-online.com
	with esmtp id 16O5rQ-0kX78UC; Wed, 9 Jan 2002 00:40:52 +0100
Received: from localhost (localhost [127.0.0.1])
	by linux.wg.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id g08NVI928007
	for <dev@lists.horde.org>; Wed, 9 Jan 2002 00:31:18 +0100
Received: from 192.168.60.1 ( [192.168.60.1])
	as user jan@linux by linux.wg.de with HTTP;
	Wed,  9 Jan 2002 00:31:18 +0100
Message-ID: <1010532678.3c3b814653d3d@linux.wg.de>
Date: Wed,  9 Jan 2002 00:31:18 +0100
From: Jan Schneider <jan@horde.org>
To: dev@lists.horde.org
References: <1864256710.20020108213148@email.si>
In-Reply-To: <1864256710.20020108213148@email.si>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: Internet Messaging Program (IMP) 4.0-cvs
X-Sender: 320034214675-0001@t-dialin.net
Subject: Re: [dev] gettext textdomain foo?

Zitat von Rudi Benkovič <rudib@email.si>:

> Hi,
> 
> While translating the Horde framework, I noticed something a bit weird
> from
> the coders perspective:
> 
> In IMP, the preferences UI (prefs.php) includes several templates from
> the
> Horde install, like this:
> 
>       include $registry->getTemplatePath("horde") . '/prefs/end.inc';
> 
> Now, the gettext textdomain at that time is set to 'imp', so that
> gettext
> strings should be looked up in IMP's gettext files - but they aren't.
> Actually, it looks up for translation from every application - you can
> even
> put a Turba message into Horde's directory of templates with a line like
> this:
> 
>     print _("Home Phone");
> 
> ...include it from IMP, and it will still get translated correctly! While
> this
> is the right way and everything, I can't find this (hidden feature? :)
> documented in the gettext or PHP docs... So, what is it? ;)

Are you really sure that it happens exactly how you describe? What we do is 
merging the application's and Horde's .po files before compiling the 
translations, this is why the Horde strings also appear in each application.

Jan.

--
::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::