[ic] interpolate

Elver Loho elver.loho at gmail.com
Fri Mar 24 10:21:32 EST 2006

On 3/24/06, Kevin Walsh <kevin at cursor.biz> wrote:
> "Elver Loho" <elver.loho at gmail.com> wrote:
> Well, firstly, it looks as if you're mixing positional and named
> parameters.  You can either do [lc2 first second] or
> [lc2 foo=first bar=second], but not mix the two.  That'll be
> the reason why you always get the default message when you do that.

How do I unpack named variables? Right now am using my ($code, $message) = @_;

Yes, I'm a Perl newbie :P

> Secondly (and the solution to your main problem) your stored text
> will need to contain references to "[var SOMEVAR]" instead of simply
> "__SOMEVAR__".  The default message will contain the value of
> __SOMEVAR__ variables, as expected, because they will be replaced
> in the text when the page is first loaded.  Variables in your
> looked-up messages will not be replaced in that way  That'll be the
> reason why you see the value of __SOMEVAR__ in the default message,
> but not in messages you grab from your database.

Ah, alright, that explains it :)

> I'm still not entirely clear why you need a [lc2] tag at all, but
> that's another matter.

Because L tags are not flexible enough. We've got to support some 6
languages, half of them Unicode, half Latin1. For the Unicode
languages, we have to filter the strings before putting them on the
page. And then there's language order issues. Like if a Latvian string
is missing, should it fall back to the default (Estonian?) or Russian
or English? For all that, we have lc2 tags :)

And for administration, we have Babel Squid:

I might release that under the GPL some day.

> I'll get my cape and be on my way. :-)



More information about the interchange-users mailing list