<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>During The Prime Hacking Hours</title>
	<link>http://wp.reedom.com</link>
	<description>ある実験君の軌跡</description>
	<pubDate>Tue, 19 Feb 2008 00:07:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Force to append lang-code to feed links</title>
		<link>http://wp.reedom.com/entry/34.html</link>
		<comments>http://wp.reedom.com/entry/34.html#comments</comments>
		<pubDate>Tue, 31 Jul 2007 03:23:42 +0000</pubDate>
		<dc:creator>reedom</dc:creator>
		
		<category><![CDATA[personal]]></category>
<category>gengo</category><category>wordpress</category>
		<guid isPermaLink="false">http://wp.reedom.com/entry/34.html/en/</guid>
		<description><![CDATA[
I think rss feeds should always have language code, no matter what the Gengo setting is.
So, I made a patch.


[before]
http://wp.reedom.com/feed
[after]
http://wp.reedom.com/feed/ja/




Index: gengo.php
===================================================================
&#8212; gengo.php   (revision 106)
+++ gengo.php   (working copy)
@@ -175,7 +175,7 @@
                      [...]]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>I think rss feeds should always have language code, no matter what the Gengo setting is.</p>
<p>So, I made a patch.</p>

<dl>
<dt>[before]</dt>
<dd>http://wp.reedom.com/feed</dd>
<dt>[after]</dt>
<dd>http://wp.reedom.com/feed/ja/</dd>
</dl>

<div class="scrollbars">
<pre class="hatena-super-pre">
<span class="synType">Index: gengo.php</span>
===================================================================
<span class="synType">&#8212; gengo.php   (revision 106)</span>
<span class="synType">+++ gengo.php   (working copy)</span>
<span class="synStatement">@@ -175,7 +175,7 @@</span>
                                add_filter(&#8217;year_link&#8217;, array(&amp; $this,&#8217;append_links&#8217;));
                                add_filter(&#8217;month_link&#8217;, array(&amp; $this,&#8217;append_links&#8217;));
                                add_filter(&#8217;day_link&#8217;, array(&amp; $this,&#8217;append_links&#8217;));
<span class="synSpecial">-                               add_filter(&#8217;feed_link&#8217;, array(&amp; $this,&#8217;append_links&#8217;));</span>
<span class="synIdentifier">+                               add_filter(&#8217;feed_link&#8217;, array(&amp; $this,&#8217;append_feed_links&#8217;));</span>
                                add_filter(&#8217;post_comments_feed_link&#8217;, array(&amp; $this,&#8217;post_comments_feed_link&#8217;));

                                // SQL control.
<span class="synStatement">@@ -654,6 +654,12 @@</span>
                return $this-&gt;append_link_language($link, $this-&gt;viewable_code_string);
        }

<span class="synIdentifier">+       // Append language codes to other links.</span>
<span class="synIdentifier">+       function append_feed_links($link) {</span>
<span class="synIdentifier">+        $this-&gt;forced_append = true;</span>
<span class="synIdentifier">+               return $this-&gt;append_link_language($link, $this-&gt;viewable_code_string);</span>
<span class="synIdentifier">+       }</span>
<span class="synIdentifier">+</span>
        // Called from wp_list_pages.
        function get_pages($pages, $arguments) {
          global $wpdb;
<span class="synStatement">@@ -730,7 +736,8 @@</span>
        function post_comments_feed_link($url) {
          global $post;
          if (get_option(&#8217;permalink_structure&#8217;)) $url = preg_replace(&quot;|/$post-&gt;code/$|&quot;, &#8216;/&#8217;, $url);
<span class="synSpecial">-               return $this-&gt;append_link_language($url, $post-&gt;code);</span>
<span class="synIdentifier">+      $this-&gt;forced_append = true;</span>
<span class="synIdentifier">+      return $this-&gt;append_link_language($url, $post-&gt;code, false);</span>
        }

        // Define the language query variable.
</pre>
</div>
<p>&nbsp;</p>
<a title="Download version 0 of gengo-0.9.1-alpha-4-langcode-to-feedlink.patch" onclick="if (window.urchinTracker) urchinTracker ('/patches/gengo-0.9.1-alpha-4-langcode-to-feedlink.patch');" href="/patches/gengo-0.9.1-alpha-4-langcode-to-feedlink.patch">Download the patch &raquo;</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wp.reedom.com/entry/34.html/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Redirect loop</title>
		<link>http://wp.reedom.com/entry/32.html</link>
		<comments>http://wp.reedom.com/entry/32.html#comments</comments>
		<pubDate>Mon, 30 Jul 2007 11:22:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[wordpress]]></category>
<category>gengo</category><category>wordpress</category>
		<guid isPermaLink="false">http://wp.reedom.com/entry/32.html/ja/</guid>
		<description><![CDATA[
Days before I experienced redirect loops when I tested the `tag search&#8217; feature of SimpleTagging. I thought `Gengo should be worked something wrong.&#8217; then I looked around Gengo&#8217;s setting pages and found that disabling `&#8221;Gengo should append language codes to permalinks automatically.&#8217; feature could hide the problem.
Till today, I&#8217;ve killed off bugs in Gengo I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>Days before I experienced redirect loops when I tested the `tag search&#8217; feature of <a href="http://simpletagging.herewithme.fr/">SimpleTagging</a>. I thought `Gengo should be worked something wrong.&#8217; then I looked around Gengo&#8217;s setting pages and found that disabling `&#8221;Gengo should append language codes to permalinks automatically.&#8217; feature could hide the problem.</p>
<p>Till today, I&#8217;ve killed off bugs in Gengo I&#8217;ve seen. I&#8217;ve got some knowledge of Gengo.</p>
<p>And finally I found `the solution&#8217; to the issue.</p>

<pre class="hatena-super-pre">
open `Gengo Exclusions' page in admin panel, 
add &quot;/tag&quot; to `Exclusions' box.
</pre>

<p>Oh, yeah, the exact way is provided by the author.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wp.reedom.com/entry/32.html/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>without language codes to permalink may causes 404</title>
		<link>http://wp.reedom.com/entry/28.html</link>
		<comments>http://wp.reedom.com/entry/28.html#comments</comments>
		<pubDate>Tue, 24 Jul 2007 10:24:15 +0000</pubDate>
		<dc:creator>reedom</dc:creator>
		
		<category><![CDATA[personal]]></category>
<category>gengo</category><category>wordpress</category>
		<guid isPermaLink="false">http://wp.reedom.com/entry/28.html</guid>
		<description><![CDATA[
After activating SimpleTagging plugin I faced some problem. To avoid that I disabled the Gengo&#8217;s feature `Gengo should append language codes to permalinks automatically.&#8217;. 
Days later I noticed a WordPress&#8217; strange behavior.
I have pages having translations and when I clicked a link to the another language&#8217;s page then I saw a `404 Error&#8217; page. 
That&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>After activating <a href="http://simpletagging.herewithme.fr/">SimpleTagging plugin</a> I faced some problem. To avoid that I disabled the Gengo&#8217;s feature <em>`Gengo should append language codes to permalinks automatically.&#8217;</em>. </p>
<p>Days later I noticed a WordPress&#8217; strange behavior.</p>
<p>I have pages having translations and when I clicked a link to the another language&#8217;s page then I saw a `404 Error&#8217; page. </p>
<p>That&#8217;s strange.</p>

<p>Went further investigation I found a bad smelling code in the <var>`locale&#8217;</var> filter.</p>

<div class="scrollbars">
<pre class="hatena-super-pre">
<span class="synType">Index: gengo.php</span>
===================================================================
<span class="synType">&#8212; gengo.php   (revision 80)</span>
<span class="synType">+++ gengo.php   (working copy)</span>
<span class="synStatement">@@ -1222,7 +1222,7 @@</span>
  } else {
    $value = $parser-&gt;query_vars[&#8217;pagename&#8217;];
    if (($position = strpos($parser-&gt;query_vars[&#8217;pagename&#8217;], &#8216;/&#8217;)) !== false) {
<span class="synSpecial">-     $value = substr($value, $position + 1);</span>
<span class="synIdentifier">+     $value = substr($value, 0, $position);</span>
    }
    $where = &quot;p.post_name = &#8216;$value&#8217;&quot;;
    $join = &quot;INNER JOIN $wpdb-&gt;posts AS p ON p.ID = p2l.post_id&quot;;
</pre>
</div>

<p>One of the pair pages I faced 404 error have 3 depth hierarchy.</p>
<pre class="hatena-super-pre">
software/wordpress-plugins/l10n-helper.html    &lt;English&gt;
software_ja/wordpress-plugins/l10n-helper.html &lt;Japanese&gt;
</pre>
<p>Before modification the value of <var>$value</var> was set as:</p>
<pre class="hatena-super-pre">
wordpress-plugins/l10n-helper.html &lt;English&gt;
wordpress-plugins/l10n-helper.html &lt;Japanese&gt;
</pre>
<p><var>$wpdb->posts.post_name</var> only have a post name for 1 depth of hierarchy but the code got of 2 depth. And the code does not seem to care of WordPress feature that it allows to have same post name among pages while the top of ancestors of those page&#8217;s are not same.</p>

<p>I fixed the code to obtain the first part of uri.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wp.reedom.com/entry/28.html/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Gengo and cache</title>
		<link>http://wp.reedom.com/entry/27.html</link>
		<comments>http://wp.reedom.com/entry/27.html#comments</comments>
		<pubDate>Tue, 24 Jul 2007 05:03:02 +0000</pubDate>
		<dc:creator>reedom</dc:creator>
		
		<category><![CDATA[personal]]></category>
<category>gengo</category><category>wordpress</category>
		<guid isPermaLink="false">http://wp.reedom.com/entry/27.html</guid>
		<description><![CDATA[Under WP_Cache enabled site Gengo could be problematic.]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>It seems that Gengo cares WordPress&#8217; cache feature a bit but not entirely.<br/>I don&#8217;t know it comes from the fact that the cache feature is disabled by default.</p>
<p>Anyway there must be some bugs on it.</p>
<p>Past days I saw a kind of it  on category listing then I gave away the category listing and replaced by <a href="http://simpletagging.herewithme.fr/">SimpleTagging</a>.</p>
<p>After that I noticed that there was similar thing on page listing. I couldn&#8217;t throw away this feature. I needed it.</p>

<p>The problem was that the page list block in the sidebar could be empty for all locales but the one visited firstly after cache feature had been enabled or cache for the page listing had expired.</p>

<p>I tried to fix the bug and have done.</p>

<p>I made a function <var>gengo_list_pages()</var>, which is to be replaced by <var>wp_list_pages()</var> in sidebar.php, in general.</p>
<pre class="hatena-super-pre">
<span class="synSpecial">&lt;?php</span>
<span class="synStatement">if</span> <span class="synSpecial">(</span><span class="synStatement">!</span><span class="synIdentifier">function_exists</span><span class="synSpecial">(</span>&#8216;<span class="synConstant">gengo_list_pages</span>&#8216;<span class="synSpecial">))</span> <span class="synSpecial">{</span>
<span class="synPreProc">function</span> gengo_list_pages<span class="synSpecial">(</span><span class="synStatement">$</span><span class="synIdentifier">args</span> <span class="synStatement">=</span> &#8221;<span class="synSpecial">)</span> <span class="synSpecial">{</span>
    <span class="synStatement">if</span> <span class="synSpecial">(</span><span class="synIdentifier">is_array</span><span class="synSpecial">(</span><span class="synStatement">$</span><span class="synIdentifier">args</span><span class="synSpecial">))</span> <span class="synSpecial">{</span>
        <span class="synStatement">$</span><span class="synIdentifier">r</span> <span class="synType">= &amp;</span><span class="synStatement">$</span><span class="synIdentifier">args</span>;
    <span class="synSpecial">}</span> <span class="synStatement">else</span> <span class="synSpecial">{</span>
        <span class="synIdentifier">parse_str</span><span class="synSpecial">(</span><span class="synStatement">$</span><span class="synIdentifier">args</span>, <span class="synStatement">$</span><span class="synIdentifier">r</span><span class="synSpecial">)</span>;
    <span class="synSpecial">}</span>
    <span class="synStatement">$</span><span class="synIdentifier">r</span> <span class="synStatement">=</span> <span class="synIdentifier">array_merge</span><span class="synSpecial">(</span><span class="synType">array</span><span class="synSpecial">(</span>&#8216;<span class="synConstant">language</span>&#8216; <span class="synStatement">=&gt;</span> the_language<span class="synSpecial">(</span><span class="synConstant">true</span><span class="synSpecial">))</span>, <span class="synStatement">$</span><span class="synIdentifier">r</span><span class="synSpecial">)</span>;
    <span class="synStatement">return</span> wp_list_pages<span class="synSpecial">(</span><span class="synStatement">$</span><span class="synIdentifier">r</span><span class="synSpecial">)</span>;
<span class="synSpecial">}</span>
<span class="synSpecial">}</span>
<span class="synSpecial">?&gt;</span>
</pre>

<p>There is also a related bug in the core code of WordPress 2.2.1. </p>
<div class="scrollbars">
<pre class="hatena-super-pre">
<span class="synType">Index: post.php</span>
===================================================================
<span class="synType">&#8212; post.php    (revision 3)</span>
<span class="synType">+++ post.php    (working copy)</span>
<span class="synStatement">@@ -1070,9 +1070,14 @@</span>
        extract($r, EXTR_SKIP);

        $key = md5( serialize( $r ) );
<span class="synSpecial">-       if ( $cache = wp_cache_get( &#8216;get_pages&#8217;, &#8216;page&#8217; ) )</span>
<span class="synSpecial">-               if ( isset( $cache[ $key ] ) )</span>
<span class="synSpecial">-                       return apply_filters(&#8217;get_pages&#8217;, $cache[ $key ], $r );</span>
<span class="synIdentifier">+       if ( $cache = wp_cache_get( &#8216;get_pages&#8217;, &#8216;page&#8217; ) ) {</span>
<span class="synIdentifier">+               if ( isset( $cache[ $key ] ) ) {</span>
<span class="synIdentifier">+                       $pages = apply_filters(&#8217;get_pages&#8217;, $cache[ $key ], $r );</span>
<span class="synIdentifier">+            if ( $pages &amp;&amp; ( $child_of || $hierarchical ) )</span>
<span class="synIdentifier">+                $pages = &amp; get_page_children($child_of, $pages);</span>
<span class="synIdentifier">+            return $pages;</span>
<span class="synIdentifier">+        }</span>
<span class="synIdentifier">+    }</span>

        $inclusions = &#8221;;
        if ( !empty($include) ) {
</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wp.reedom.com/entry/27.html/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Installed `Gengo&#8217;</title>
		<link>http://wp.reedom.com/entry/14.html</link>
		<comments>http://wp.reedom.com/entry/14.html#comments</comments>
		<pubDate>Fri, 06 Jul 2007 02:14:50 +0000</pubDate>
		<dc:creator>reedom</dc:creator>
		
		<category><![CDATA[wordpress]]></category>
<category>wordpress</category>
		<guid isPermaLink="false">http://wp.reedom.com/entry/14/en/</guid>
		<description><![CDATA[
I installed Gengo, a WordPress plugin, which enables WordPress to write blog/Pages in multi languages.
But its installation was painful. Very poor document - there&#8217;s only FAQ but not manual. What&#8217;s `Summary&#8217;? What&#8217;s `Group&#8217; in Gengo context? Force users to build installation knowledge from a tiny pieces in FAQ. Just nonsense. 

]]></description>
			<content:encoded><![CDATA[<div class="section">
<p>I installed <a href="http://jamietalbot.com/wp-hacks/gengo/">Gengo</a>, a WordPress plugin, which enables WordPress to write blog/Pages in multi languages.</p>
<p>But its installation was painful. Very poor document - there&#8217;s only FAQ but not manual. What&#8217;s `Summary&#8217;? What&#8217;s `Group&#8217; in Gengo context? Force users to build installation knowledge from a tiny pieces in FAQ. Just nonsense. </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://wp.reedom.com/entry/14.html/feed/en/</wfw:commentRss>
		</item>
	</channel>
</rss>
