On Mon, Jun 25, 2001 at 02:41:32PM +0200, Ferenc Engard wrote:
> Hi all,
> 
> There are two issues with a multiple language Midgard site:
> 
> 1. How can I implement multiple language website? I suppose I put the
> text into style elements, but how to switch language? Changing styles is
> not the best solution... :( Or should have to put the different language
> sites into different websites, and all the common parts into the
> attached style...? Suggestions?
> 
> 2. If I want to put articles with title/abstract/other in 2 languages,
> how should I do it? I have two ideas: first, I have to put into
> parameters, second, I use some kind of structure in the title/abstract
> fields (e.g., split with '|', use of tags etc.). Tips?
First, look at my previous posting on this topic:
http://marc.theaimsgroup.com/?l=midgard-user&m=98036567721111&w=2

For content localization it is generally better to use article's replies
to store localized versions of the article. This way your articles will
contain English text of document and replies to articles will provide
translations.

For example:
/Some topic
        / Article 'ABCD' contains English (USA) text
                /Reply 'fr_FR' contains same text but in French for France
                /Reply 'en_UK' -- // -- English for UK
                /Reply 'ru_UA' -- // -- Russian for Ukraine

And so on. Next, you could use, for example, active page, in order to
define which translation you would like to show. Something like
'/path/to/page/LANGCODE/article_id.html'.

Then you'll receive LANGCODE as $argv[0] and article id as $argv[1].
<?php
        $langcode = $argv[0];
        $article_id = $argv[1];
        $article = mgd_get_article($article_id);
        if($article) {
                if($langcode != 'en_US') {
                        $translation = mgd_get_reply_by_name($article_id,
                                $langcode);
                        if($translation) $article = $translation;
                }
                /* Code to show article */
        }
?>

--
Sincerely yours, Alexander Bokovoy 
  The Midgard Project   | www.midgard-project.org | ALT Linux Team
Minsk Linux Users Group |    www.minsk-lug.net    | www.altlinux.ru
-- Mother told me to be good but she's been wrong before.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to