Re: New Blog and and 1 question
Piotras <pp-VVDi8QVAvoBWk0Htik3J/[email protected]> Tue, 24 Jan 2006 15:24:40 +0100
| Newsgroups | gmane.comp.web.midgard.user |
|---|---|
| Message-ID | <[email protected]> |
"med" <[email protected]> wrote: > Now for the question: > I'd like to set up a multi-language site without midcom using old-aegir style > (well actually it's about adding english translation-articles to a german site) > , but midgard-api-reference about the language section is a bit behind of normal "completeness"... > Has anyone done something like that and can give some usefull tips/tutorials to that? All you have to do is to call mgd_set_lang($int lang). When article is created set lang to de and call update method. This will create german translation of Your article. <?php $art = new midgard_article(); $art->get_by_id($id); mgd_set_lang($de_lang_id); $art->content = "german content"; $art->update(); mgd_set_lang(0); ?> Of course you must set and define lang somehow. It may be passed in url , set from browser, etc. Set lang again to get article with correct translation. <?php /* some code which gets current lang */ mgd_set_lang($lang_id); $art = new midgard_article(); $art->get_by_id($id); ?> &(art.content); Piotras