<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>me talking out loud &#187; IntSmarty</title>
	<atom:link href="http://www.khankennels.com/blog/index.php/archives/category/computers/php/intsmarty/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.khankennels.com/blog</link>
	<description>Lig&#039;s accidentally overheard ramblings on MySQL/PHP and life in general</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:27:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>IntSmarty added</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2005/07/07/intsmarty-added/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2005/07/07/intsmarty-added/#comments</comments>
		<pubDate>Thu, 07 Jul 2005 07:09:28 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=205</guid>
		<description><![CDATA[I have posted on the code snippet page a couple of things. My hacked version of IntSmarty is there, as well as the MyIntSmarty class I used, and finally the newArticle template converted over to use it. I have written in this blog extensively about my experiences learning and hacking IntSmarty. The creation of the [...]]]></description>
			<content:encoded><![CDATA[<p>I have posted on the <a href="http://www.khankennels.com/code/codeIndex.html">code snippet</a> page a couple of things.   My <a href="http://www.khankennels.com/code/intsmarty.txt">hacked version of IntSmarty</a> is there, as well as the <a href="http://www.khankennels.com/code/MyIntSmarty.class.php.txt">MyIntSmarty</a> class I used, and finally the <a href="http://www.khankennels.com/code/newArticleInt.tpl.txt">newArticle template</a> converted over to use it.   I  have written in this<a href="http://www.khankennels.com/blog/index.php/archives/category/computers/php/intsmarty/"><br />
blog extensively about my experiences learning and hacking IntSmarty</a>.  The creation of the MyIntSmarty was also discussed.  </p>
<p>If you look at the original newArticle template and the revised one &#8211; you will probably see very little difference (minus the few slight layout changes I made for the inclusion of a navigation menu).  All I had to do was add the {l} and {/l} tags around the text I wanted translated.  How easy is that.</p>
<p>Hopefully this will help anyone who has to create a multilingual site (mine was Japanese, English and eventually Korean).  It really isn&#8217;t that hard once you get the basics &#8211; so do your homework.  If you have a hard time getting this to work or have a question about it please let me know &#8211; I&#8217;d be more then willing to help you figure it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2005/07/07/intsmarty-added/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Newest page &#8211; and translation</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2005/01/20/newest-page-and-translation/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2005/01/20/newest-page-and-translation/#comments</comments>
		<pubDate>Fri, 21 Jan 2005 06:20:52 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=112</guid>
		<description><![CDATA[Well the first page of my administrative area is up and running (debugged and minor testing). Will be starting the next page tomorrow. Worked on fixing a few bugs and Photoshop all day today. Was a nice change of pace. The Project Manager/Translator finally had a chance to see her translation in context and hated [...]]]></description>
			<content:encoded><![CDATA[<p>Well the first page of my administrative area is up and running (debugged and minor testing).  Will be starting the next page tomorrow.  Worked on fixing a few bugs and Photoshop all day today.  Was a nice change of pace.</p>
<p>The Project Manager/Translator finally had a chance to see her translation in context and hated it. <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Said it looked like a bad translation script was used.  HEHE.  She asked to have the files re-sent so she could do a better job this time.  Luckily I had just finished the first admin page.  Wonder if she is surprised by the size of the translation file (it is getting pretty large). <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2005/01/20/newest-page-and-translation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>problem fixed</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2005/01/05/problem-fixed/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2005/01/05/problem-fixed/#comments</comments>
		<pubDate>Thu, 06 Jan 2005 05:44:41 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=102</guid>
		<description><![CDATA[Well I&#8217;m back at work (about a week now) and working on my project. Got some things done on varaction but not as much as I wanted. *shrug* My boss is actually letting me code all day instead of doing all the other million things I have to do so I am actually getting somewhere. [...]]]></description>
			<content:encoded><![CDATA[<p>Well I&#8217;m back at work (about a week now) and working on my project.  Got some things done on varaction but not as much as I wanted. *shrug*  My boss is actually letting me code all day instead of doing all the other million things I have to do so I am actually getting somewhere.</p>
<p>While I was just hanging out on the PHPCommunity channel today coogle came around asking about the IntSmarty project.  Told him about my current problem and sent him the translation file that crashed the site.  Wouldn&#8217;t ya know it &#8211; it about 5 minutes he saw where/how  the translation file formating was screwed up (there were stray single quote marks and a comma where there should not have been).  John reminded me that the single quotes will end the translation string so I had extra strings just hanging around messing up the parsing.  So I fix it and what do you know &#8211; it works.  </p>
<p>John also commented that it seems I found a bug in the PHP.  I haven&#8217;t a clue how or where so I asked him to report it since he would know more about the actual details involved (I only know that it didn&#8217;t work and what I did before hand).  I admit it &#8211; I am a CIS person not a CS.  I don&#8217;t care how it works as long as it does.  <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well I now have a total of 4 pages up and running.  2 are in English and Japanese, 2 in only English.  Still have to code the administrative area, backend cron programs- and get a korean translation to try that out on the pages.  I almost feel done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2005/01/05/problem-fixed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>new problem with the project</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/12/22/new-problem-with-the-project/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/12/22/new-problem-with-the-project/#comments</comments>
		<pubDate>Thu, 23 Dec 2004 01:27:06 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=95</guid>
		<description><![CDATA[Well I got the translation file back from Tokyo for the index page. Uploaded the file&#8230; and everything died. &#8211; figures. Anyway, here is the current scenario&#8230; opened the site in English and navigated through it with no problems. Made Japanese the prefered language (In Mozilla &#8211; Edit ->Preferences. In the Navigator list go to [...]]]></description>
			<content:encoded><![CDATA[<p>Well I got the translation file back from Tokyo for the index page.  Uploaded the file&#8230; and everything died. <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8211; figures. </p>
<p>Anyway, here is the current scenario&#8230; opened the site in English and navigated through it with no problems.  Made Japanese the prefered language (In Mozilla &#8211; Edit ->Preferences.  In the Navigator list go to languages and add it or move it up to the top of the list.)  and reloaded.  Blank white page with the status bar saying Done.  </p>
<p>Hmm.  Time to find out where the problem is with a little debugging.  Put in a few echos to see what is happening.  Upload and reload.  Blank white page.  View page source -> Nothing.  Not even a openning and closing html tag.  Hmm.  Check the error logs to see if it says anything&#8230; Nothing.  Go to the access logs to see if any information is there about what is going on&#8230; Nothing.  Not even an entry to say that someone has requested a japanese page.  Now that is interesting.</p>
<p>Got to the PHPCommunity IRC channel and ask the guys there since I&#8217;m stumped.  Explain to them what is going on and what I have done.  It is suggested that there may be a problem with the interaction of the PHP and the Apache since the requests aren&#8217;t even making it to the access logs.  I then recalled an email I got from the hosting service that they are upgrading the version of PHP and the Zend Optimizer.  So maybe I am just catching it in the middle of the upgrade&#8230;</p>
<p>Someone else (cnb to be exact) suggests I try rolling back the translation file.  Daah &#8211; I do need to verify it isn&#8217;t the new file.  So I dig out the old file and reload it.  And don&#8217;t ya know it works again!  So it is the translation file that is the problem.  Hours of work trying to figure out the problem and it is the stupid file.  Grrr.</p>
<p>Have downloaded a clean new translation file and sent it back out to the translator.  Made sure to tell them not to mess around with the format.  Never did find out exactly what the problem was.</p>
<p>So now I will be going back to work on the next page.  Almost there.  Have the templates done and ~80% of the logic.  Hopefully will have the logic done soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/12/22/new-problem-with-the-project/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Index page for IntSmarty</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/12/17/index-page-for-intsmarty/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/12/17/index-page-for-intsmarty/#comments</comments>
		<pubDate>Fri, 17 Dec 2004 19:34:02 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=94</guid>
		<description><![CDATA[Well I have just finished the index page and it was much more complex then the login page. In English &#8211; it is working fine. I have just sent out the translation table to my co-worker in Toyko and will hopefully be getting it back soon. Will let ya know how it goes.]]></description>
			<content:encoded><![CDATA[<p>Well I have just finished the index page and it was much more complex then the login page.  In English &#8211; it is working fine.  I have just sent out the translation table to my co-worker in Toyko and will hopefully be getting it back soon.  Will let ya know how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/12/17/index-page-for-intsmarty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Index page</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/11/27/index-page/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/11/27/index-page/#comments</comments>
		<pubDate>Sun, 28 Nov 2004 05:53:56 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=89</guid>
		<description><![CDATA[Well I have about 2/3 of my index page working in English (4 of the 5 templates are being used). Planning on working on the last 1/3 tomorrow. Then I have to send out the tranlation files and get them back. I wonder if this page will work without a hitch? Hey &#8211; I can [...]]]></description>
			<content:encoded><![CDATA[<p>Well I have about 2/3 of my index page working in English (4 of the 5 templates are being used).  Planning on working on the last 1/3 tomorrow.  Then I have to send out the tranlation files and get them back.  I wonder if this page will work without a hitch?  Hey &#8211; I can hope!</p>
<p>(Man &#8211; this sucks not being able to talk about the specifics of the project &#8211; never mind not being able to show it.  But the company does own it and it is going to be proprietary software&#8230; *sigh*)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/11/27/index-page/feed/</wfw:commentRss>
		<slash:comments>324</slash:comments>
		</item>
		<item>
		<title>IntSmarty working completely (Finally and for now)</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/11/23/intsmarty-working-completely-finally-and-for-now/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/11/23/intsmarty-working-completely-finally-and-for-now/#comments</comments>
		<pubDate>Wed, 24 Nov 2004 06:23:18 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=88</guid>
		<description><![CDATA[Well I finally have the Intsmarty completly displaying the login page correctly. YEAH!!! The problem was in the smarty_lang_prefilter. The code originally has the strings being replaced in the ISO-8859-1 character set (using the utf8_decode). But my page is in the utf8 character set (so it can be more flexable). So of course there were [...]]]></description>
			<content:encoded><![CDATA[<p>Well I finally have the Intsmarty completly displaying the login page correctly. YEAH!!!</p>
<p>The problem was in the smarty_lang_prefilter.   The code originally has the strings being replaced in the ISO-8859-1 character set (using the utf8_decode).  But my page is in the utf8 character set (so it can be more flexable). So of course there were problems with the display of 2 character sets on 1 page.  Once I removed the the utf8_decode it worked perfectly.</p>
<p>[php]<br />
/**<br />
* hack starting here<br />
*/</p>
<p>/** the line below is the original line of code<br />
*$content = preg_replace(&#8220;!{$ldq}l{$rdq}$q_str{$ldq}/l{$rdq}!s&#8221;,<br />
*utf8_decode($inst->translation [$hash]), $content);<br />
*/</p>
<p>// here I am removing the utf8_decode because my page is in the utf8 character set<br />
$content = preg_replace(&#8220;!{$ldq}l{$rdq}$q_str{$ldq}/l{$rdq}!s&#8221;,$inst->translation [$hash], $content);</p>
<p>/**<br />
* end hack<br />
*/[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/11/23/intsmarty-working-completely-finally-and-for-now/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>IntSmarty Temporarily suspended</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/11/21/intsmarty-temporarily-suspended/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/11/21/intsmarty-temporarily-suspended/#comments</comments>
		<pubDate>Mon, 22 Nov 2004 06:17:42 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=85</guid>
		<description><![CDATA[Well this past week I have had to suspend all work on the IntSmarty project&#8230;. Just have too many other things to do before I go stateside for a month. With the problems I&#8217;m having with the IntSmarty handling the Japanese and the work required to straighten it out&#8230; I can&#8217;t take the time right [...]]]></description>
			<content:encoded><![CDATA[<p>Well this past week I have had to suspend all work on the IntSmarty project&#8230;. Just have too many other things to do before I go stateside for a month.  With the problems I&#8217;m having with the IntSmarty handling the Japanese and the work required to straighten it out&#8230; I can&#8217;t take the time right now. *sigh*  Have been catching up on all my other projects and duties (and unfortunately my paperwork).  Hope to restart work on the IntSmarty next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/11/21/intsmarty-temporarily-suspended/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hiccup with Smarty</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/11/13/hiccup-with-intsmarty/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/11/13/hiccup-with-intsmarty/#comments</comments>
		<pubDate>Sun, 14 Nov 2004 00:15:32 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=82</guid>
		<description><![CDATA[Well I jave my japanese file loaded and the page runs. Few problems though. The translation strings for the error messages (use cnb&#8217;s myGettext on those) are working fine in English and Japanese. The problem is in the IntSmarty or Smarty. I personally think it is the Smarty. Ok here goes my theory &#8211; IntSmarty [...]]]></description>
			<content:encoded><![CDATA[<p>Well I jave my japanese file loaded and the page runs.  Few problems though.  The translation strings for the error messages (use cnb&#8217;s myGettext on those) are working fine in English and Japanese.  The problem is in the IntSmarty or Smarty.  I personally think  it is the Smarty.  Ok here goes my theory &#8211; IntSmarty does its job and gets the string conversion in the alternate language and passes it to the Smarty to put into the template.  Smarty however doesn&#8217;t know what to do with the multibyte strings or how to display them, so I get the wonderful ???? strings.</p>
<p>Sent an email to coogle (John Coogeshall &#8211; the creator of IntSmarty) telling him of my problem and my opinion of what and where the problem is.  He very quickly got back to me that he would take a look.  And today he sent me another email saying that he thinks there is a  &#8220;problem with multibyte support&#8221; and is taking a closer look.  Man I really wish I knew Smarty and how it works.  Will be taking a look at it&#8217;s code when I get back to work and see if I can pinpoint the problem since coogle does have another job (Congrats by the way and I hope you enjoy your new job at Zend) that has nothing to do with me and my problems ( <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).  More minds working the better.  Will keep you posted.</p>
<p>Oh and I am just about ready to load the index page and all it&#8217;s templates on to the server and start debugging that page.  Want to first get it working in English.  Maybe by then I will have a solution for the problem I am having with the multibyte strings.  The index page is much more complex then the login screen so I am sure I will having a couple of new problems. <img src='http://www.khankennels.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And one more shout out to coogle &#8211; Thank you for your help with solving this problem.  I know you are very busy, so I really appreciate you taking the time to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/11/13/hiccup-with-intsmarty/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>code clip for IntSmarty</title>
		<link>http://www.khankennels.com/blog/index.php/archives/2004/11/11/code-clip-for-intsmarty/</link>
		<comments>http://www.khankennels.com/blog/index.php/archives/2004/11/11/code-clip-for-intsmarty/#comments</comments>
		<pubDate>Thu, 11 Nov 2004 23:26:36 +0000</pubDate>
		<dc:creator>lig</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IntSmarty]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=80</guid>
		<description><![CDATA[Well I finally remembered to ask my friend if I could post his code to the blog and he said yes. so here it is: [php] function myGettext($value) { $hash = md5($value); if (key_exists($hash, $this->translation)) { $value = $this->translation[$hash]; } else { $this->translation[$hash] = $value; } return $value; } [/php] cnb is an awesome programmer [...]]]></description>
			<content:encoded><![CDATA[<p>Well I finally remembered to ask my friend if I could post his code to the blog and he said yes.  so here it is:<br />
[php]<br />
function myGettext($value) {<br />
        $hash = md5($value);<br />
        if (key_exists($hash, $this->translation)) {<br />
            $value = $this->translation[$hash];<br />
        } else {<br />
            $this->translation[$hash] = $value;<br />
        }</p>
<p>        return $value;<br />
    }<br />
[/php]</p>
<p>cnb is an awesome programmer and guy.  You should checkout out his <a href="http://blog.cnb.se">blog</a> to learn more about him and what he is currently doing in the world of PHP.  I would also like to thank the people on the <a href="http://www.phpcommunity.org/blog/">PHPCommunity</a> IRC channel (#phpc on freenode) for helping me get this far.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.khankennels.com/blog/index.php/archives/2004/11/11/code-clip-for-intsmarty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

