<?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>Victor Hung%27s Diary</title>
	<atom:link href="https://taskinghouse.com/posts/tag/poedit/feed/" rel="self" type="application/rss+xml" />
	<link>https://taskinghouse.com</link>
	<description></description>
	<lastBuildDate>Mon, 13 May 2019 06:46:32 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.1</generator>

<image>
	<url>https://taskinghouse.com/wp-content/uploads/2018/05/cropped-favicon.png</url>
	<title>Poedit &#8211; TaskingHouse</title>
	<link>https://taskinghouse.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</title>
		<link>https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/</link>
		
		<dc:creator><![CDATA[Victor Hung]]></dc:creator>
		<pubDate>Thu, 30 Aug 2018 16:00:19 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[Loco Translate]]></category>
		<category><![CDATA[Poedit]]></category>
		<category><![CDATA[本地化]]></category>
		<category><![CDATA[翻譯]]></category>
		<guid isPermaLink="false">https://diary.taskinghouse.com/?p=2035</guid>

					<description><![CDATA[<p>如果你的部落格也是使用 WordPress 建置，因為大部分 WordPress 主題大多都是國外開發，除了 WordPress 核心已經翻譯成繁體中文的字串外...</p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/">「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></description>
										<content:encoded><![CDATA[<p>如果你的部落格也是使用 WordPress 建置，因為大部分 WordPress 主題大多都是國外開發，除了 WordPress 核心已經翻譯成繁體中文的字串外，在網頁前台主題顯示的介面可能都會是英文的，如顯示全部分類的按鈕「Show All」這種，一般來說可以透過 Loco Translate 這套外掛，直接在後台將這些字串翻譯成中文。</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-2077" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-01.png" alt="" width="1200" height="630" /></p>
<p>不過有些字串在 Loco Translate 搜尋不到，根本無法翻譯。這種情形，通常是主題的作者沒有更新 WordPress 語言檔，因此在最新的主題版本中出現在字串，不在語言包的目錄中。可以注意一下目前主題的語言檔中總共有 1,075 筆字串。</p>
<p><img decoding="async" class="alignnone size-medium wp-image-2078" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-02.png" alt="" width="1200" height="630" /></p>
<p>先到 <a href="https://poedit.net/" target="_blank" rel="noopener">Poedit 的官網</a>免費下載 Poedit。開啟 Poedit 後點選「翻譯 WordPress 主題或外掛」，選擇「本電腦上」並匯入主題資料夾。這邊可以直接將主題資料夾拖曳到白色區域中，注意是「主題資料夾」不是一般在 WordPress 後台上傳的「壓縮安裝檔」。</p>
<p>如果你的主題是在 ThemeForest 購買的，可以先到 <a class="global-header-dropdown__link " href="https://themeforest.net/downloads" target="_blank" rel="noopener"><span class="global-header-dropdown__link-text">Downloads</span></a> 頁面，在主題右邊下載按鈕選擇「Installable WordPress file only」將下載的壓縮安裝檔解開，這個資料夾就是我們要的。</p>
<p><img decoding="async" class="alignnone size-medium wp-image-2079" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-03.png" alt="" width="1200" height="738" /></p>
<p>如果網站上的主題，已經使用 Loco Translate 翻譯了一些字串，那麼就沒有必要重頭開始翻譯，因此我們在 Poedit 選擇「建立 POT」</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2080" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-04.png" alt="" width="1200" height="738" /></p>
<p>Poedit 將會分析 WordPress 主題或外掛的程式碼，並抽出可翻譯的字串，並將其合併製作成 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2081" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-05.png" alt="" width="1200" height="630" /></p>
<p>預設的儲存路徑是主題資料夾中的「languages」，按下儲存，覆蓋原本 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2082" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-06.png" alt="" width="1200" height="739" /></p>
<p>這個新的 POT 語言檔包含了主題中所有可翻譯的字串。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2083" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-07.png" alt="" width="1200" height="630" /></p>
<p>我們將這個檔案透過 FTP 上傳到網站目錄相對的位置，也就是網頁目錄 &gt; wp-content &gt; 主題資料夾 &gt; languages，取代原本的 POT 語言檔。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2084" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-08.png" alt="" width="1200" height="630" /></p>
<p>接著我們回到後台的 Loco Translate，可以看到還是只有 1075 筆字串，不用擔心，直接按下「同步」</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2085" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-09.png" alt="" width="1200" height="630" /></p>
<p>Loco Translate 從新的 POT 語言檔抓取字串，新增了 436 筆字串，同時也淘汰 36 筆字串。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2086" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-10.png" alt="" width="1200" height="630" /></p>
<p>重新搜尋，已經可以找到剛剛要翻譯的字串</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2087" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-11.png" alt="" width="1200" height="630" /></p>
<p>翻譯完成，儲存，前台正確顯示。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2088" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-12.png" alt="" width="1200" height="630" /></p>
<p>有時候同個字串會在很多地方出現，例如「Search」這個字串，因為搜尋功能可能是網頁前台文章的搜尋、可能是網頁後台 Theme Option 的搜尋，這個時候我們可以從 Loco Translate 的「程式碼」頁籤確認每個字串的位置。</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-2089" style="border: 5px solid #fff;" src="https://taskinghouse.com/wp-content/uploads/2018/08/loco-poedit-13.png" alt="" width="1200" height="630" /></p>
<p>這篇文章 <a rel="nofollow" href="https://taskinghouse.com/posts/translate-wordpress-that-loco-translate-cant-with-poedit/">「教學」使用 Poedit 抓取 Loco Translate 遺失的 WordPress 翻譯字串</a> 最早出現於 <a rel="nofollow" href="https://taskinghouse.com">TaskingHouse</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
