<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum CakePHP.org.pl - i18n i relacje z innymi modelami]]></title>
	<link rel="self" href="http://forum.cakephp.org.pl/feed/atom/topic/105/"/>
	<updated>2009-09-17T14:40:52Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.cakephp.org.pl/topic/105/i18n-i-relacje-z-innymi-modelami/</id>
		<entry>
			<title type="html"><![CDATA[i18n i relacje z innymi modelami]]></title>
			<link rel="alternate" href="http://forum.cakephp.org.pl/post/504/#p504"/>
			<content type="html"><![CDATA[<p>witam,</p><p>Mam dwa modele - Product oraz Science.<br />Product hasMany Science.</p><p>Zarówno model Product jak i model Science są tłumaczone przez i18n. Problem polega na tym, że gdy czytam dane produktu i mam ustawione recuresive np. na 1 lub więcej to w tablicy dostaję przetłumaczone dane Product z tabeli i18n, ale&nbsp; nieprzetlumaczone dane na sztywno wczytane z tabelki sciences.</p><p>tak wyglada controller<br /></p><div class="codebox"><pre><code>&lt;?php
class ProductsController extends AppController {

    var $name = &#039;Products&#039;;
    var $helpers = array(&#039;Html&#039;, &#039;Form&#039;,&#039;FlvPlayer&#039;,&#039;Text&#039;);
    //var $layout = &#039;products&#039;;
    
    
    
    function index() {
        $this-&gt;Product-&gt;recursive = 0;
        $this-&gt;set(&#039;products&#039;, $this-&gt;paginate());
        $this-&gt;layout = &#039;products&#039;;
    }

    function view($id = null) {
        if (!$id) {
            $this-&gt;Session-&gt;setFlash(__(&#039;Invalid Product.&#039;, true));
            $this-&gt;redirect(array(&#039;action&#039;=&gt;&#039;index&#039;));
        }
        $this-&gt;set(&#039;product&#039;, $this-&gt;Product-&gt;read(null, $id));
        $this-&gt;layout = &#039;products&#039;;
    }
    
    function science($id = null) {
        if (!$id) {
            $this-&gt;Session-&gt;setFlash(__(&#039;Invalid Product.&#039;, true));
            $this-&gt;redirect(array(&#039;action&#039;=&gt;&#039;index&#039;));
        }
        $this-&gt;Product-&gt;recuresive = 1;
        $this-&gt;set(&#039;product&#039;, $this-&gt;Product-&gt;read(null, $id));
        $this-&gt;layout = &#039;products&#039;;
    }</code></pre></div><p>dlaczego te dane nie są przetlumaczone? </p><p>Jeśli próbuję dostać się do danych bezpośrednio z controllera sciences tłumaczy jak należy.</p><p>pozdr.</p>]]></content>
			<author>
				<name><![CDATA[gaw]]></name>
				<uri>http://forum.cakephp.org.pl/user/95/</uri>
			</author>
			<updated>2009-09-17T14:40:52Z</updated>
			<id>http://forum.cakephp.org.pl/post/504/#p504</id>
		</entry>
</feed>

