Sergio Bruder wrote:
>
> I came with this solution:
>
> in the page I only this:
> <?
> local_page();
> ?>
>
> in a PHP_INIT element in the style:
>
> function local_page() {
<[skip]>
> }
>
> which retrieves the page *ELEMENT* with the same name of the current language,
> $lang (en, pt_BR, es, etcetera). If the page element is not found, we retrieve
> the default language, pt_BR in this case.
>
> Note that with the :p modifier I can put even PHP code in the page elements.
>
> With this setup I can solve the static content problem:
> All pages will have only the <? local_page(); ?> content, and we put all the
> real content in en, pt_BR, es, etcetera, page elements (even with PHP code.
> UHU!!).
Even more: you could drop completely <[content]> call in your style
definition and replace it with
<? local_page(); ?>
:-)
Current CVS version now has mgd_get_reply_by_name($articleid, $name)
well suited exactly for building multilanguage sites (which use 8-bit
encodings). You store article in default language and all translations
as replies to it with names equal to language codes ($lang) and then
just do:
<?
$article = ($lang != $DEFAULT_LANG) ?
mgd_get_reply_by_name($articleid, $lang) :
mgd_get_article($articleid);
?>
--
Alexander Bokovoy
No use getting too involved in life -- you're only here for a limited
time.
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]