On Fri, Aug 18, 2000 at 02:51:49PM +0300, Alexander Bokovoy wrote:
> Sergio Bruder wrote:
> > I came with this solution:
> > <? 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

Using local_page as a function gave me some problems about SCOPE (variables
used in the PHP code in pages), so I transformed the function in a style
element, now my pages are:

<(local_page)>

This solution is good only for the static content. 

Now I have two diferent trees of topics&articles to create a "defered
translation", where a translator can query "what articles don't have
translation to the X language?"

-- 

Sergio D. Bruder

[EMAIL PROTECTED], [EMAIL PROTECTED]
------------------------------------------
http://www.conectiva.com.br
http://sergio.bruder.net
http://pontobr.org

--
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]


Reply via email to