Форуми / Cotonti / Extensions / Multilanguage and news plugin

howto

ez
#26005 09.09.2010 17:35
Hi Gert,

Tnx..I am already rewriting the news plugin for language support... ;)
And got it to work!!

Index Template (TPL):
<div class="block">
 {INDEX_NEWS_NL_NL_NEWS}
 {INDEX_NEWS_EN_EN_NEWS}
</div>

In the news.php i do:
  $ttmp=sed_get_news($v[0], "news.".$v[0], $v[1], $dadd, $v[2]);
  $t->assign("INDEX_NEWS_".strtoupper($v[0]), $ttmp);
  //sed_watch("INDEX_NEWS_".strtoupper($usr['lang'])."_".strtoupper($v[0]), $ttmp);
  $t->assign("INDEX_NEWS_".strtoupper($usr['lang'])."_".strtoupper($v[0]), $ttmp);

My pagecategories are named:
en_homepage
en_news
nl_homepage
nl_news

Notice the use of '_' instead of '-'
It turned out that Xtemplate cannot use '-' in the assign ?????


And I got separate tpl files for all separate news cats..
You cannot use the rewrite rules from the i18n example.. it needs '_'.

------------------------------------------------------------------------
Good idea about the original news cat as a fallback, I will use that!

Releasing it will be difficult, because i have a custom news plugin..
I use a half baked 0.9 news plugin with additional hooks and other stuff I changed.
==- I say: Keep it EZ -==