[kdewebdev-site] Phase I design and development opportunities
jacob coby
jcobync at yahoo.com
Thu Apr 15 15:59:29 EDT 2004
--- Eric Laffoon <eric at kdewebdev.org> wrote:
> Chris has proposed an idea based on what KDE does.
> In reflection I think KDE
> was set up with this interesting and unique
> procedure because of their
> familiarity with the tools. In thinking about this
> the idea of being able to
> use an XML processor within PHP and the ability to
> add tags in XHTML gives me
> the idea that this abstraction could be accomplished
> using XML. It would
> require a definition of the page layout elements and
> an XML name for those
> elements which would make content writing sort of
> like writing docs.
Before I start thinking about this more, just to be
sure, this sounds like you want to do a template
system of sorts in XML?
<page title="A page at kdewebdev">
<nav section="some:where:in:kdewebdev" />
<content>
<p><t>This is some text to be translated</t></p>
<p><t>Quanta at <url src="http://quanta.kdewebdev.org"
text="quanta.kdewebdev.org /></t></p>
</content>
</page>
(<t> = text to translate. Just a time-saver over
typing <i18n> or <l10n>.)
Once you have this, we'd then run some sort of XML
processor written in PHP to generate the final .php
file?
> Ironically it would even be possible to still use
> elements of Chris' PHP code
> and solution here. My problem though is that I don't
> want to require every
> string to actually be written in a PHP function and
> I want the translation to
> be as web developer oriented as possible.
Just to expand on Chris' response, since the
translated files would (could?) be an include() based
on your language, it would be fast and easy on the
server (esp. if an accelerator were installed such as
zend or PHP-Accelerator).
<p><i18n>Some Text</i18n></p>
<p><i18n>Some other text</i18n></p>
could become:
<?php
// logic to setup $lang here (cookies, defaults,
verification)
include ("lang/$lang.php"); // en.php, de.php,
whatever
?>
<p><?=$i18n_0?></p>
<p><?=$i18n_1?></p>
-- eof
We include ~600k per page with PHPA running, and it
only takes about 0.05 seconds to do the include.
=====
--
-Jacob
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html
More information about the kdewebdev-site
mailing list