|
From: Shane <sh...@lo...> - 2004-07-26 20:29:48
|
On Jul 22, 2004, at 12:54 PM, James Marca wrote:
> At approximately Wed, Jul 21, 2004 at 06:58:52AM -0400, Shane wrote:
> ...
>>
>> One of the PITA things about Slash, for me (IMHO), has always been the
>> language inside the stock theme's templates.
>>
> ...
>> If more text/language was only shown through the getData command, it
>> might have the added benefit of making internationalizing a slash
>> site's text easier. Because instead of changing a ton of templates,
>> you're changing the language in the data* templates (I think there may
>> be error* template(s) too, I may be wrong).
>>
>> Any thoughts?
>>
> Seems like a good idea. I can think of two areas of concern. One is
> performance---if you look up each bit of text, how much extra
> processing has to be done?
I guess that depends on whether caching is turned on our not.
Probably, too, whether or not memcached and a read-only db-slave is
used.
> Second, modularization is always good in
> theory, but it takes a lot of work. That's a big up front cost for
> the Slashcode team to pay for not much benefit for them, as they don't
> change the language of their templates.
True. But they do a) change the code and b) want the slash-addons
community to expand and increase involement. Yes, it'd be a lot of
work. Painful, and ugly and not fun like creating something entirely
new. (IMHO) But it'd make it easier for others try and help support the
code as well.
>
> As to implementation, I have another suggestion. Instead of calling
> the get data template with
>
>> Slash.getData('loginform_err2')
>
> Could there be one text template per one layout template, that defined
> variables filled with text? Hmm, make that two. So at the top of
> each (layout) template, there is one line that loads "stock" language
> template, and a second one that loads "custom" language template, like
>
> foo is [% foo %] is undefined?
>
> [% PROCESS "language_$template_stock" %]
> foo is [% foo %], defined in stock
>
> [% PROCESS "language_$template_custom" %]
> foo is [% foo %], if defined in custom it overrides stock
>
> Custom language is empty by default, but is where you would put your
> text bits that override the default.
Hmmm. That seems like it'd work. I wonder what the performance
difference
would be. I'm guessing that if template-caching is on, there is no
performance difference between either method. But if it's not on, there
could be a big difference between what I was throwing out and what
you're suggesting.
Any comments from the OSDN guys? You guys have the most experience
dealing with performance-related issues due to /. so you all could
probably shed some light on this... ???
Shane
|