<?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>ward fifteen &#187; Blog</title>
	<atom:link href="http://wardfifteen.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://wardfifteen.com</link>
	<description>Delivering creative solutions since 1998</description>
	<lastBuildDate>Thu, 25 Jul 2024 16:54:08 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>FIAT 127 study</title>
		<link>http://wardfifteen.com/fiat-127-study/</link>
		<comments>http://wardfifteen.com/fiat-127-study/#comments</comments>
		<pubDate>Sun, 18 Aug 2013 12:49:32 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Sketchpad]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[sketches]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=430</guid>
		<description><![CDATA[Pencil drawing of my family's first car]]></description>
				<content:encoded><![CDATA[<p>Pencil drawing of my family&#8217;s first car</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/fiat-127-study/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common problems of wordpress theme translations</title>
		<link>http://wardfifteen.com/common-problems-of-wordpress-theme-translations/</link>
		<comments>http://wardfifteen.com/common-problems-of-wordpress-theme-translations/#comments</comments>
		<pubDate>Fri, 13 Nov 2015 13:41:20 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[multilingual]]></category>
		<category><![CDATA[wordpress customization]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=296</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p>Buying a WordPress theme with multilingual compatibility doesn&#8217;t necessarily mean you&#8217;ll have an easy time creating a translated version for your website. If you&#8217;re into WordPress long enough, you probably frown when you see that sought after &#8216;WPML ready&#8217; tag in the description of your No.1-pick-theme, since that particular specification hasn&#8217;t exactly proven accurate. In fact, trying to create translated pages for your website could end up being a quite a time-consuming task, since it is usually more about fixing bugs than entering your client&#8217;s content.</p>
<p>Multilingual-ready themes are often launched with many oversights, such as a homepage that displays content from both languages, or strings that refuse to translate. Every time I&#8217;ve come across an issue like this, I&#8217;ve wasted many hours trying to fix it, looking at various sources and trying out numerous possible solutions. Gathering all those issues and their fixes in this article will hopefully save other developers the time and the frustration I&#8217;ve experienced. Below are a number of translation problems that might be giving you a headache, along with their possible solutions &#8212; at least the solutions that worked for me.</p>
<h3>Case #1: The <i>suppress_filters</i> parameter</h3>
<p>A classic case of multilingual confusion is when a page, block or shortcode element displays content in both or all languages. This issue usually occurs because of a missing <code>'suppress_filters' =&gt; false</code> in the list of parameters of the <code>get_posts</code> function.</p>
<p>Let&#8217;s say, for example, that the services box on your homepage displays your services in both English and Greek. Locate the php file containing the template for the services box and add the <i>suppress_filters</i> parameter, as seen in the following example:</p>
<pre><code>$args = array(
 'post_type' =&gt;'services',
 'numberposts' =&gt; -1,
 'tax_query' =&gt; $service_tax_query,
 <span style="color: #dd656c;">'suppress_filters' =&gt; false</span>
);
$services_posts = get_posts($args);</code></pre>
<p>This applies for the <code>get_posts</code> function since it uses <code>'suppress_filters' =&gt; true</code> as the default. The <code>query_posts</code> function, on the other hand, applies filters by default.</p>
<p><a href="https://codex.wordpress.org/Template_Tags/get_posts" target="_blank">More info about the <i>suppress_filters</i> parameter at the WordPress Codex page →</a></p>
<h3>Case #2: The <i>GetText</i> call</h3>
<p>Sometimes you&#8217;ll notice that a few strings here and there refuse to translate. They either remain in your primary language after you enter a translation for them or they are not listed in your String Translation tool at all. This usually happens because the theme&#8217;s author skipped adding the GetText call for the particular strings. What you need to do is locate the templates with the stubborn strings and add the GetText call accordingly, as described in the following examples. For readability, the texts in question are colored <span style="color: #0083cf;">blue</span> and the added code is in <span style="color: #dd656c;">red</span>.</p>
<p><b>Example 2.1:</b> For echoed strings, the text needs to be wrapped in the GetText call <code>_e()</code> (translatable echo).<br />
Before:</p>
<pre><code>&lt;h2&gt;<span style="color: #0083cf;">Links</span>&lt;/h2&gt;</code></pre>
<p>After:</p>
<pre><code>&lt;h2&gt;<span style="color: #dd656c;">&lt;?php _e('<span style="color: #0083cf;">Links</span>','theme-text-domain'); ?&gt;</span>&lt;/h2&gt;</code></pre>
<p><b>Example 2.2:</b> For phrases that include both static and dynamic text, the solution is to use the <code>__()</code> GetText call, which is suitable for returned strings and doesn’t write to the output like <code>_e()</code> does. The output is done by wrapping everything in a <code>printf</code> call.<br />
Before:</p>
<pre><code><span style="color: #0083cf;">by</span> &lt;?php echo(the_author('', false)); ?&gt;</code></pre>
<p>After:</p>
<pre><code>&lt;?php <span style="color: #dd656c;">printf( __( '<span style="color: #0083cf;">by</span> %s', 'theme-text-domain' ),</span> the_author('', false) <span style="color: #dd656c;">);</span> ?&gt;</code></pre>
<p>The term <i>&#8216;theme-text-domain&#8217;</i> is generic and should be replaced with your theme&#8217;s textdomain. This is a unique identifier for retrieving translated strings and can be usually found in your theme&#8217;s functions.php:</p>
<pre><code>load_theme_textdomain( 'theme-text-domain', get_template_directory().'/languages' );</code></pre>
<p><a href="https://wpml.org/faq/language-setup/" target="_blank">More info about the <i>GetText</i> call at the WPML Multilingual Plugin Blog →</a></p>
<h3>Case #3: Strings inside a <i>register_taxonomy</i> function</h3>
<p>In the following example, the GetText call must be added around strings that are defined inside functions.<br />
<b>Before:</b></p>
<pre><code>register_taxonomy('portfolio_category', 'portfolio',
 array(
  'hierarchical' =&gt; true,
  'label' =&gt; '<span style="color: #0083cf;">Portfolio Categories</span>',
  'singular_name' =&gt; '<span style="color: #0083cf;">Category</span>',
  "rewrite" =&gt; true,
  "query_var" =&gt; true
 )
);</code></pre>
<p><b>After:</b></p>
<pre><code>register_taxonomy('portfolio_category', 'portfolio',
 array(
 'hierarchical' =&gt; true,
 'label' =&gt; <span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">Portfolio Categories</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>,
 'singular_name' =&gt; <span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">Category</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>,
 "rewrite" =&gt; true,
 "query_var" =&gt; true
 )
);</code></pre>
<h3>Case #4: Strings inside a <i>sending_mail</i> function</h3>
<p>Some themes contain built-in forms that don&#8217;t allow text to be translated in their sending mail function. In the following example the GetText call needs to be wrapped around the static text of the sent message.</p>
<p><b>Before:</b></p>
<pre><code>function sending_mail(){
 
 $theme = get_bloginfo('name');
 $subject = $_POST['subject'];
 $email = $_POST['email'];
 $comments = $_POST['comments'];
 $name = $_POST['name'];

 $to = get_bloginfo('admin_email');
 $message = "<span style="color: #0083cf;">Name:</span> $name \n\n<span style="color: #0083cf;">Email:</span> $email \n\n<span style="color: #0083cf;">Comments:</span> $comments \n\n<span style="color: #0083cf;">This email has been sent from</span> $theme"; 
 $headers = 'From: '.$name. "\r\n" . 'Reply-To: ' . $email;

 mail($to, $subject, $message, $headers);
}</code></pre>
<p><b>After:</b></p>
<pre><code>function sending_mail(){
 
 $theme = get_bloginfo('name');
 $subject = $_POST['subject'];
 $email = $_POST['email'];
 $comments = $_POST['comments'];
 $name = $_POST['name'];

 $to = get_bloginfo('admin_email');
 $message = <span style="color: #dd656c;">__("<span style="color: #0083cf;">Name:</span>" , "theme-text-domain") . " " .</span> $name <span style="color: #dd656c;">. "</span>\n\n<span style="color: #dd656c;">" . __("<span style="color: #0083cf;">Email:</span>" , "theme-text-domain") . " " .</span> $email <span style="color: #dd656c;">. "</span>\n\n<span style="color: #dd656c;">" . __("<span style="color: #0083cf;">Comments:</span>" , "theme-text-domain") . " " .</span> $comments <span style="color: #dd656c;">. "</span>\n\n<span style="color: #dd656c;">" . __("<span style="color: #0083cf;">This email has been sent from</span>" , "theme-text-domain") . " " .</span> $theme; 
 $headers = 'From: '.$name. "\r\n" . 'Reply-To: ' . $email;

 mail($to, $subject, $message, $headers);
}</code></pre>
<h3>Case #5: Other examples within functions</h3>
<p><b>Example 5.1</b><br />
Before:</p>
<pre><code>&lt;?php comments_popup_link('<span style="color: #0083cf;">No Comments</span>', '<span style="color: #0083cf;">1 Comment</span>', '<span style="color: #0083cf;">% Comments</span>'); ?&gt;</code></pre>
<p>After:</p>
<pre><code>&lt;?php comments_popup_link(<span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">No Comments</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>, <span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">1 Comment</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>, <span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">% Comments</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>); ?&gt;</code></pre>
<p><b>Example 5.2</b><br />
Before:</p>
<pre><code>&lt;a href="#"&gt;&lt;?php next_posts_link('<span style="color: #0083cf;">&amp;#x2190; Previous</span>') ?&gt;&lt;/a&gt;</code></pre>
<p>After:</p>
<pre><code>&lt;a href="#"&gt;&lt;?php next_posts_link(<span style="color: #dd656c;">__(</span>'<span style="color: #0083cf;">&amp;#x2190; Previous</span>'<span style="color: #dd656c;">, 'theme-text-domain')</span>) ?&gt;&lt;/a&gt;</code></pre>
<h3>Case #6: Missing thumbnails in the second language</h3>
<p>One less common case is when post thumbnails are not visible when we switch language. I came across this particular issue in a theme that used the Aqua Resizer function v1.1.3 to generate the thumbnails. To fix it, the line below, located in aq_resizer.php, had to be commented out. It was used to check if the images&#8217; URLs are local and it probably conflicted with the addition of the language directory in the website url.</p>
<pre><code>if(strpos( $url, home_url() ) === false) return false;</code></pre>
<p>This issue was fixed in version 1.1.4.</p>
<h3>Case #7: Non-translatable widget text</h3>
<p>Scanning the theme for strings, you may notice that while the titles of certain widgets are listed for translation, the text entered in their textareas is missing. This issue can be fixed with the use of the <code>icl_translate()</code> function.</p>
<p><b>Before:</b></p>
<pre><code>$address = $instance['address'];</code></pre>
<p><b>After:</b></p>
<pre><code>$address = <span style="color: #dd656c;">icl_translate('wpml_custom', 'wpml_custom_' . sanitize_title( $instance["address"] ),</span> $instance['address']<span style="color: #dd656c;">)</span>;</code></pre>
<p>This applies for WPML versions &lt; 3.2.</p>
<p><a href="https://wpml.org/documentation/support/translation-for-texts-by-other-plugins-and-themes/" target="_blank">More information on translating user input texts at the WPML Documentation →</a></p>
<h3>Note:</h3>
<p>After you make changes to the theme&#8217;s code, in order for the texts to show up in the list of strings for translation, you should rescan the theme for strings in your String Translation tool.</p>
<hr />
<p><i>This article is just a partial overview of common issues regarding the translation of a WordPress website. Any updates or corrections are welcome as well as any contributions that would make it more comprehensive.</i></p>
<hr />
<div class="addtoany_shortcode"><div class="a2a_kit a2a_kit_size_32 addtoany_list a2a_target" id="wpa2a_1"><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="Facebook" rel="nofollow" target="_blank"></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="Twitter" rel="nofollow" target="_blank"></a><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="Google+" rel="nofollow" target="_blank"></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="LinkedIn" rel="nofollow" target="_blank"></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="Reddit" rel="nofollow" target="_blank"></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;linkname=Common%20problems%20of%20wordpress%20theme%20translations" title="DZone" rel="nofollow" target="_blank"></a><a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwardfifteen.com%2Fcommon-problems-of-wordpress-theme-translations%2F&amp;title=Common%20problems%20of%20wordpress%20theme%20translations"></a></div></div>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/common-problems-of-wordpress-theme-translations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sketches #1: Vintage Cars</title>
		<link>http://wardfifteen.com/sketches-1-vintage-cars/</link>
		<comments>http://wardfifteen.com/sketches-1-vintage-cars/#comments</comments>
		<pubDate>Tue, 08 Dec 2015 13:40:56 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Sketchpad]]></category>
		<category><![CDATA[sketches]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=510</guid>
		<description><![CDATA[Series of sketches I made with my son's crayons]]></description>
				<content:encoded><![CDATA[<p>Rediscovering the fun of sketching, thanks to my young son</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/sketches-1-vintage-cars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sketches #2: More Cars</title>
		<link>http://wardfifteen.com/sketches-2-more-cars/</link>
		<comments>http://wardfifteen.com/sketches-2-more-cars/#comments</comments>
		<pubDate>Fri, 18 Dec 2015 00:06:57 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Sketchpad]]></category>
		<category><![CDATA[sketches]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=581</guid>
		<description><![CDATA[The one with the farmer's market]]></description>
				<content:encoded><![CDATA[<p>Putting things in the car trunk is a huge delight for a 2-year old.</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/sketches-2-more-cars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sketches #3: Animal Farm</title>
		<link>http://wardfifteen.com/sketches-3-animal-farm/</link>
		<comments>http://wardfifteen.com/sketches-3-animal-farm/#comments</comments>
		<pubDate>Thu, 17 Dec 2015 17:48:26 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Sketchpad]]></category>
		<category><![CDATA[sketches]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=574</guid>
		<description><![CDATA[More fun with crayons!]]></description>
				<content:encoded><![CDATA[<p>Crayons are fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/sketches-3-animal-farm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sketches #4: Kitchen Variations</title>
		<link>http://wardfifteen.com/sketches-4-kitchen-variations/</link>
		<comments>http://wardfifteen.com/sketches-4-kitchen-variations/#comments</comments>
		<pubDate>Fri, 18 Dec 2015 14:16:12 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Sketchpad]]></category>
		<category><![CDATA[sketches]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=594</guid>
		<description><![CDATA[A classic toddler theme]]></description>
				<content:encoded><![CDATA[<p>In a toddler’s list of requested drawings, this theme is definitely a classic.</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/sketches-4-kitchen-variations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grand opening</title>
		<link>http://wardfifteen.com/ward15-website-launch/</link>
		<comments>http://wardfifteen.com/ward15-website-launch/#comments</comments>
		<pubDate>Tue, 21 Apr 2015 11:30:36 +0000</pubDate>
		<dc:creator><![CDATA[ward15]]></dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://wardfifteen.com/?p=1</guid>
		<description><![CDATA[Ward15 website launch]]></description>
				<content:encoded><![CDATA[<p>Welcome to the base of operations.<br />
Slide your request <a title="Contact" href="http://wardfifteen.com/contact/">under the door</a>. Ward15 will offer you a solution you can&#8217;t refuse.</p>
]]></content:encoded>
			<wfw:commentRss>http://wardfifteen.com/ward15-website-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
