<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multilingual Website with CakePHP</title>
	<atom:link href="http://savasplace.com/2009/08/multilingual-website-with-cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/</link>
	<description>Free PHP scripts, CSS templates, Making Money Online and Miscellaneous Ramblings</description>
	<lastBuildDate>Mon, 09 Apr 2012 11:51:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: karo</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-961</link>
		<dc:creator>karo</dc:creator>
		<pubDate>Sun, 21 Nov 2010 14:25:23 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-961</guid>
		<description>Please help, i don&#039;t seem to understand something here... these .po files contain small site-wide strings, like filed-names etc... but what about the actual pages&#039; content? i need to give the site owner a chance to add croatian and english version of each page (i.e. page&#039;s main content, e.i. long texts). I already made the cms and have the separate fileds for page text in either language (db fields are text_cro and text_en). 
How do i grab and show the correct text?

Thanx!</description>
		<content:encoded><![CDATA[<p>Please help, i don&#8217;t seem to understand something here&#8230; these .po files contain small site-wide strings, like filed-names etc&#8230; but what about the actual pages&#8217; content? i need to give the site owner a chance to add croatian and english version of each page (i.e. page&#8217;s main content, e.i. long texts). I already made the cms and have the separate fileds for page text in either language (db fields are text_cro and text_en).<br />
How do i grab and show the correct text?</p>
<p>Thanx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sava</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-849</link>
		<dc:creator>Sava</dc:creator>
		<pubDate>Tue, 06 Jul 2010 15:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-849</guid>
		<description>let&#039;s say you have 2 languages: romanian and english.
The links would look something like this:
&lt;code&gt;
				&lt;?php if($this-&gt;params[&#039;lang&#039;] == &#039;ro&#039;){ echo &#039;Romana&#039;;} else { echo $html-&gt;link(&#039;Romana&#039;, am($this-&gt;params[&#039;pass&#039;], array(&#039;lang&#039; =&gt; &#039;ro&#039;)));}?&gt;
				&lt;?php if($this-&gt;params[&#039;lang&#039;] == &#039;en&#039;) {echo &#039;English&#039;;} else {echo $html-&gt;link(&#039;English&#039;, am($this-&gt;params[&#039;pass&#039;], array(&#039;lang&#039; =&gt; &#039;en&#039;)));}?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>let&#8217;s say you have 2 languages: romanian and english.<br />
The links would look something like this:<br />
<code><br />
				< ?php if($this->params['lang'] == 'ro'){ echo 'Romana';} else { echo $html->link('Romana', am($this->params['pass'], array('lang' => 'ro')));}?><br />
				< ?php if($this->params['lang'] == 'en') {echo 'English';} else {echo $html->link('English', am($this->params['pass'], array('lang' => 'en')));}?><br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yasir Arafat Hasib</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-840</link>
		<dc:creator>Yasir Arafat Hasib</dc:creator>
		<pubDate>Thu, 01 Jul 2010 04:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-840</guid>
		<description>How do i make a link for home page that will change the language in home page?</description>
		<content:encoded><![CDATA[<p>How do i make a link for home page that will change the language in home page?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sava</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-597</link>
		<dc:creator>Sava</dc:creator>
		<pubDate>Tue, 04 May 2010 12:45:28 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-597</guid>
		<description>You need to edit the &lt;strong&gt;model &lt;/strong&gt;as well for multiple languages :

&lt;code&gt;
	var $actsAs = array(
		&#039;Translate&#039; =&gt; array(
			&#039;field1&#039;            =&gt; &#039;Field 1&#039;,
			&#039;field2&#039;         =&gt; &#039;Field 2&#039;,
			&#039;field3&#039;       =&gt; &#039;Field 3&#039;
		)
	);
&lt;/code&gt;

And in your views you need to add this code for every field you want translated:

&lt;code&gt;
			&lt;?
			$title = Set::combine($this-&gt;data[&#039;title&#039;], &#039;{n}.locale&#039;, &#039;{n}.content&#039;);
			foreach(Configure::read(&#039;Config.languages&#039;) as $codeLang =&gt; $locale):
			e($form-&gt;input(
					&#039;Contest.title.&#039;.$locale[&#039;locale&#039;],
						array(
							&#039;label&#039; =&gt; &#039;(&#039;.$codeLang.&#039;)&#039;,
							&#039;value&#039; =&gt; isset($title[$locale[&#039;locale&#039;]]) ? $title[$locale[&#039;locale&#039;]] : &#039;&#039;,
							&#039;class&#039; =&gt; &#039;textField&#039;
							)
					));
			endforeach;
			?&gt;
&lt;/code&gt;

... this code will create a form input for each of the languages you configured CakePHP to use</description>
		<content:encoded><![CDATA[<p>You need to edit the <strong>model </strong>as well for multiple languages :</p>
<p><code><br />
	var $actsAs = array(<br />
		'Translate' => array(<br />
			'field1'            => 'Field 1',<br />
			'field2'         => 'Field 2',<br />
			'field3'       => 'Field 3'<br />
		)<br />
	);<br />
</code></p>
<p>And in your views you need to add this code for every field you want translated:</p>
<p><code><br />
			< ?<br />
			$title = Set::combine($this->data['title'], '{n}.locale', '{n}.content');<br />
			foreach(Configure::read('Config.languages') as $codeLang => $locale):<br />
			e($form->input(<br />
					'Contest.title.'.$locale['locale'],<br />
						array(<br />
							'label' => '('.$codeLang.')',<br />
							'value' => isset($title[$locale['locale']]) ? $title[$locale['locale']] : '',<br />
							'class' => 'textField'<br />
							)<br />
					));<br />
			endforeach;<br />
			?><br />
</code></p>
<p>&#8230; this code will create a form input for each of the languages you configured CakePHP to use</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jayu</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-589</link>
		<dc:creator>jayu</dc:creator>
		<pubDate>Tue, 27 Apr 2010 13:41:45 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-589</guid>
		<description>Hello,

I am new in cake php. I want to create site which support multiple language support. I follow step given by you also create two table name (1) i18n (2)  posts
here is the table structure

CREATE TABLE `i18n` (
  `id` int(10) NOT NULL auto_increment,
  `locale` varchar(6) NOT NULL,
  `model` varchar(255) NOT NULL,
  `foreign_key` int(10) NOT NULL,
  `field` varchar(255) NOT NULL,
  `content` mediumtext,
  PRIMARY KEY  (`id`),
  KEY `locale` (`locale`),
  KEY `model` (`model`),
  KEY `row_id` (`foreign_key`),
  KEY `field` (`field`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

but when try to implement in my view its not working properly. Can you please guide me.</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I am new in cake php. I want to create site which support multiple language support. I follow step given by you also create two table name (1) i18n (2)  posts<br />
here is the table structure</p>
<p>CREATE TABLE `i18n` (<br />
  `id` int(10) NOT NULL auto_increment,<br />
  `locale` varchar(6) NOT NULL,<br />
  `model` varchar(255) NOT NULL,<br />
  `foreign_key` int(10) NOT NULL,<br />
  `field` varchar(255) NOT NULL,<br />
  `content` mediumtext,<br />
  PRIMARY KEY  (`id`),<br />
  KEY `locale` (`locale`),<br />
  KEY `model` (`model`),<br />
  KEY `row_id` (`foreign_key`),<br />
  KEY `field` (`field`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</p>
<p>but when try to implement in my view its not working properly. Can you please guide me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sava</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-540</link>
		<dc:creator>Sava</dc:creator>
		<pubDate>Mon, 29 Mar 2010 06:34:46 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-540</guid>
		<description>Hello Farhan,
You can read about using arabic characters here: http://bakery.cakephp.org/articles/view/unaneem-com-a-community-website-built-on-cakephp-with-extensive-use-of-ajax

Scroll down and find &quot;&lt;strong&gt;Challenges we had to face and overcome using CakePHP&lt;/strong&gt;. There&#039;s a nice custom substring UTF-8 method (needs mb_string to be loaded) you should use.</description>
		<content:encoded><![CDATA[<p>Hello Farhan,<br />
You can read about using arabic characters here: <a href="http://bakery.cakephp.org/articles/view/unaneem-com-a-community-website-built-on-cakephp-with-extensive-use-of-ajax" rel="nofollow">http://bakery.cakephp.org/articles/view/unaneem-com-a-community-website-built-on-cakephp-with-extensive-use-of-ajax</a></p>
<p>Scroll down and find &#8220;<strong>Challenges we had to face and overcome using CakePHP</strong>. There&#039;s a nice custom substring UTF-8 method (needs mb_string to be loaded) you should use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farhan</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-538</link>
		<dc:creator>Farhan</dc:creator>
		<pubDate>Sat, 27 Mar 2010 12:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-538</guid>
		<description>Thanks for writing a nice article, i have followed your way and by manually using Configure::write(&#039;Config.language&#039;, &#039;ro&#039;); i can do anything. 
I have one question everything works fine but when i use hebrew or arabic language to display i saved them in utf8 .po file. But inside view i see garbage characters instead of correct characters? can you elaborate little bit how we can manage this??</description>
		<content:encoded><![CDATA[<p>Thanks for writing a nice article, i have followed your way and by manually using Configure::write(&#8216;Config.language&#8217;, &#8216;ro&#8217;); i can do anything.<br />
I have one question everything works fine but when i use hebrew or arabic language to display i saved them in utf8 .po file. But inside view i see garbage characters instead of correct characters? can you elaborate little bit how we can manage this??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sava</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-497</link>
		<dc:creator>Sava</dc:creator>
		<pubDate>Fri, 29 Jan 2010 12:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-497</guid>
		<description>@Shamun,
All you have to do is to take the browser&#039;s language like this:
&lt;code&gt;
$language = $_SERVER[&#039;HTTP_ACCEPT_LANGUAGE&#039;];
&lt;/code&gt;

and $language will be &lt;strong&gt;en-us,en;q=0.5&lt;/strong&gt; in my case.
You can also get an easier to use string with &lt;strong&gt;&lt;a href=&quot;http://php.net/manual/en/function.substr.php&quot; rel=&quot;nofollow&quot;&gt;substr&lt;/a&gt;&lt;/strong&gt;.

&lt;code&gt;
$language = substr($_SERVER[&#039;HTTP_ACCEPT_LANGUAGE&#039;], 0, 2);
&lt;/code&gt;

And &lt;strong&gt;$language&lt;/strong&gt; will be &lt;strong&gt;en&lt;/strong&gt;.

And now just tell cakephp to use the language files for $language.</description>
		<content:encoded><![CDATA[<p>@Shamun,<br />
All you have to do is to take the browser&#8217;s language like this:<br />
<code><br />
$language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];<br />
</code></p>
<p>and $language will be <strong>en-us,en;q=0.5</strong> in my case.<br />
You can also get an easier to use string with <strong><a href="http://php.net/manual/en/function.substr.php" rel="nofollow">substr</a></strong>.</p>
<p><code><br />
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);<br />
</code></p>
<p>And <strong>$language</strong> will be <strong>en</strong>.</p>
<p>And now just tell cakephp to use the language files for $language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shamun</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-496</link>
		<dc:creator>shamun</dc:creator>
		<pubDate>Thu, 28 Jan 2010 18:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-496</guid>
		<description>@Sava: 
This is for a predefined mannual translation. Say if i have small site, but lets say i have &quot;browse, upload elements&quot;, it automatically take the default browser language.

Q. How to make browser based translation? (telling browser via cakephp, to render as romanian language or dutch or english etc, what ever, browser is supporting.)


Thank you</description>
		<content:encoded><![CDATA[<p>@Sava:<br />
This is for a predefined mannual translation. Say if i have small site, but lets say i have &#8220;browse, upload elements&#8221;, it automatically take the default browser language.</p>
<p>Q. How to make browser based translation? (telling browser via cakephp, to render as romanian language or dutch or english etc, what ever, browser is supporting.)</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sava</title>
		<link>http://savasplace.com/2009/08/multilingual-website-with-cakephp/comment-page-1/#comment-448</link>
		<dc:creator>Sava</dc:creator>
		<pubDate>Thu, 19 Nov 2009 10:05:39 +0000</pubDate>
		<guid isPermaLink="false">http://savasplace.com/?p=2606#comment-448</guid>
		<description>I don&#039;t really get it kapil. How can it return the string kapil if you don&#039;t have this string in your .po file.

Search through your files for the string it returns (in your case &quot;kapil&quot;) and see what the problem is there.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t really get it kapil. How can it return the string kapil if you don&#8217;t have this string in your .po file.</p>
<p>Search through your files for the string it returns (in your case &#8220;kapil&#8221;) and see what the problem is there.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

