<?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>Pressed Words &#187; Development</title>
	<atom:link href="http://pressedwords.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://pressedwords.com</link>
	<description>News and commentary about all things WordPress</description>
	<lastBuildDate>Thu, 11 Jun 2009 03:54:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<item>
		<title>Readying Plugins for the New WordPress Admin Theme</title>
		<link>http://pressedwords.com/plugin-admin-markup-for-wp-25/</link>
		<comments>http://pressedwords.com/plugin-admin-markup-for-wp-25/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 00:09:48 +0000</pubDate>
		<dc:creator><![CDATA[Austin Matzko]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[semantic web]]></category>

		<guid isPermaLink="false">http://pressedwords.com/plugin-admin-markup-for-wp-25/</guid>
		<description><![CDATA[The WordPress admin theme has been overhauled for the next version (scheduled to be released mid-March), which means that a lot of plugins&#8217; admin pages could end up looking out of place. Joost de Valk gives some brief tips on how to mark up plugin admin pages to take advantage of the new styling. Unfortunately, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>The WordPress admin theme has been overhauled for the next version (scheduled to be released mid-March), which means that a lot of plugins&#8217; admin pages could end up looking out of place.</p>
<p><a href="http://www.joostdevalk.nl/wordpress-25-plugin-settings-pages-style-guide/">Joost de Valk gives some brief tips on how to mark up plugin admin pages</a> to take advantage of the new styling.</p>
<p>Unfortunately, as he points out, the development admin style is using non-semantic markup, such as a class name of &#8220;niceblue.&#8221;  I&#8217;ve <a href="http://trac.wordpress.org/ticket/5973">created a patch</a>, so hopefully this will not still be an issue when 2.5 is released.  </p>
<p><strong>Update:</strong> &#8220;niceblue&#8221; has been changed to &#8220;form-table&#8221;, thankfully.</p>
]]></content:encoded>
			<wfw:commentRss>http://pressedwords.com/plugin-admin-markup-for-wp-25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What You Won&#8217;t See in WordPress 2.5</title>
		<link>http://pressedwords.com/what-you-wont-see-in-wordpress-25/</link>
		<comments>http://pressedwords.com/what-you-wont-see-in-wordpress-25/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 02:37:55 +0000</pubDate>
		<dc:creator><![CDATA[Austin Matzko]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Bug Hunt]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Ryan Boren]]></category>
		<category><![CDATA[Version 2.5]]></category>

		<guid isPermaLink="false">http://pressedwords.com/what-you-wont-see-in-wordpress-25/</guid>
		<description><![CDATA[One of the WordPress lead developers, Ryan Boren, announced today that WordPress 2.5 was going into &#8220;feature-freeze.&#8221; That means that the remaining month until 2.5&#8217;s March 10 release will be spent fixing the bugs in existing 2.5 features, not adding more. And that&#8217;s a lot of bugs, as much of the admin redesign hasn&#8217;t yet [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>One of the WordPress lead developers, <a href="http://boren.nu/archives/2008/02/11/25-roadmap/">Ryan Boren, announced today that WordPress 2.5 was going into &#8220;feature-freeze.&#8221;</a>  That means that the remaining month until 2.5&#8217;s March 10 release will be spent fixing the bugs in existing 2.5 features, not adding more.</p>
<p>And that&#8217;s a lot of bugs, as much of the admin redesign hasn&#8217;t yet been completed by lead developer Matt Mullenweg, who is single-handedly doing the styling redesign.  </p>
<p>Because of the feature-freeze, here are some features you <em>won&#8217;t</em> be seeing in WordPress 2.5:</p>
<ul>
<li>A <a href="http://trac.wordpress.org/ticket/5183">general meta-data table</a>, my proposal for providing a better way to deal with things like comment meta data and plugin info.</li>
<li><a href="http://trac.wordpress.org/ticket/3089">Localized plugin metadata</a>.  Currently, plugins&#8217; descriptions, names, etc., cannot be translated to the user&#8217;s language.  The problem doesn&#8217;t have a trivial solution, so it was pushed off for the future.</li>
<li><a href="http://trac.wordpress.org/ticket/5560">Automatic WordPress upgrades</a>.  The idea is for users to click a button in the WordPress dashboard and upgrade to the latest version of WordPress.  Although this didn&#8217;t make it in, automatic upgrades for themes and plugins is in 2.5 for now, with the <a href="http://trac.wordpress.org/ticket/5586#comment:18">possibility of being yanked out should it prove too buggy</a>. </li>
<li><a href="http://trac.wordpress.org/ticket/2702">Ajaxy page rearranging</a>.  This was actually <a href="http://codex.wordpress.org/GSoC2007#Hierarchical_Page_.28list.29_Management_using_jQuery">one of the 2007 WordPress Google Summer of Code projects</a>, but like all (as far as I know) of the other SoC projects has not been implemented. </li>
<li><a href="http://trac.wordpress.org/ticket/4807">Word count</a>. This seems to me like something that should be restricted to a plugin, but as it&#8217;s part of WordPress.com and was proposed by a core developer, it seemed destined to become a feature.</li>
<li><a href="http://trac.wordpress.org/ticket/5540">User roles overhaul</a>.  User capabilities have a number of problems (for example, you can&#8217;t easily sort a massive database of users by role).  So far the proposed workarounds have their own problems.</li>
<li><a href="http://trac.wordpress.org/ticket/5625">Plugin uninstall hook</a>.  There are plugin activation and deactivation events, but no plugin uninstallation events.  The idea, <a href="http://weblogtoolscollection.com/archives/2008/01/07/uninstall-is-there-such-a-thing/">pushed recently by Jeffro2pt0 on WeblogToolsCollection</a>, is something that would clear out the unused data left around by unused plugins (depending on the plugin.  This can be extensive, from numerous options values&#8212;slowing down unrelated queries&#8212;to entire database tables.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pressedwords.com/what-you-wont-see-in-wordpress-25/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>6 Tips for Localizing Your WordPress Plugin</title>
		<link>http://pressedwords.com/6-tips-for-localizing-your-wordpress-plugin/</link>
		<comments>http://pressedwords.com/6-tips-for-localizing-your-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 05:50:18 +0000</pubDate>
		<dc:creator><![CDATA[Austin Matzko]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[Localization]]></category>

		<guid isPermaLink="false">http://pressedwords.com/6-tips-for-localizing-your-wordpress-plugin/</guid>
		<description><![CDATA[Localizing (or internationalizing) your WordPress plugin means making its text capable of being translated into other languages, without having to change the plugin itself. That&#8217;s something any plugin author should want to do, considering the huge communities of non-English-speaking WordPress users and the relative ease with which internationalization can be done. Here is a list [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Internationalization_and_localization" title="Wikipedia defines localization and internationalization">Localizing</a> (or internationalizing) your <a href="http://codex.wordpress.org/Plugin_API">WordPress plugin</a> means making its text capable of being translated into other languages, without having to change the plugin itself.  That&#8217;s something any plugin author should want to do, considering the huge communities of non-English-speaking WordPress users and the relative ease with which internationalization can be done.</p>
<p>Here is a list of things to keep in mind when you&#8217;re localizing your plugin, compiled from what I&#8217;ve observed plugin authors <em>not</em> often  doing.  (See <a href="http://urbangiraffe.com/articles/localizing-wordpress-themes-and-plugins/">John Godley&#8217;s blog entry for a thorough discussion of localizing details</a> and Ronald Huereca&#8217;s good <a href="http://weblogtoolscollection.com/archives/2007/08/27/localizing-a-wordpress-plugin-using-poedit/">guide to creating the .po files WordPress uses for translating</a>). </p>
<p>Here are my suggestions, proceeding from most commonly done to least often implemented.  </p>
<ol>
<li>Remember the basics</li>
<li>Include the text domain</li>
<li>Load the domain at the right time</li>
<li>Make good use of string formatting</li>
<li>Handle plurals correctly</li>
<li>Resolve ambiguities with comments</li>
</ol>
<h2>Remember the Basics</h2>
<p>WordPress has two main localization functions: <code>__</code> and <code>_e</code>.  Wrap readable text in <code>__</code> when you want just the text output (without printing it to the screen) and <code>_e</code> when you want to print, or echo, it.  Examples:</p>
<p><code>&lt;h2&gt;&lt;?php _e('This is a printed header','my-plugin'); ?&gt;&lt;/h2&gt;</code><br />
<code>$variable = __('This string or its translation will be saved in the variable','my-plugin');</code></p>
<p>When you&#8217;re internationalizing your text, try to imagine how it will appear to a translator.  Below is how the translation file for one of my plugins appears in <a href="http://www.poedit.net/">Poedit</a>, a popular .po files editor. As you can see, each localized line appears by itself, out of context.  Keep that in mind as you localize.</p>
<p><img src='http://pressedwords.com/blog/uploads/2007/12/poedit_fcp.jpg' alt='poedit screenshot' title='Poedit screenshot showing each line of a translation file' /></p>
<p>Because localized strings of text can seem disconnected when viewed by a translator, plugin authors should try to keep discrete thoughts together.  Disjointed strings of text can be difficult for a translator to put back together in another language. </p>
<p>Don&#8217;t let markup or style be overly dependent on the structure of English.  For example, a number of languages read from right-to-left instead of left-to-right; an interface that assumes priority on the left, for example, could confuse international users.</p>
<h2>Include the Text Domain</h2>
<p>Throughout the core WordPress files, you&#8217;ll see that only one parameter is passed to the localization functions.  In the example below, it&#8217;s the string of text &#8220;Log out of this account.&#8221;  The second parameter, the text domain, is omitted, because core WordPress just uses the default domain.</p>
<p><code>&lt;?php _e('Log out of this account') ?&gt;</code></p>
<p>But your plugin needs to specify its own domain, as the text you&#8217;re translating isn&#8217;t likely to be in the core WordPress translation files.  The <a href="http://codex.wordpress.org/Writing_a_Plugin#Internationalizing_Your_Plugin">plugin text domain</a> is an arbitrary string unique to your plugin; most authors use the plugin file name minus the &#8220;.php&#8221; extension. The following line appears in the WP-DB-Backup plugin, which happens to use the file name &#8220;wp-db-backup.php.&#8221;</p>
<p><code>__('Backup Complete!','wp-db-backup')</code></p>
<h2>Load the Domain at the Right Time</h2>
<p>For plugin localization to work at all, a plugin must load the <a href="http://codex.wordpress.org/Translating_WordPress">.mo file</a> by calling <code>load_plugin_textdomain</code> at some point.  However, many plugins load it too soon.  It&#8217;s a good idea not to call <code>load_plugin_textdomain</code> any sooner than the WordPress &#8220;init&#8221; <a href="http://codex.wordpress.org/Plugin_API#Actions">action event</a>, so that the plugin will work with <a href="http://lorelle.wordpress.com/2007/02/05/translation-and-multilingual-wordpress-plugins/">other internationalization plugins</a>, plugins which might be doing things that need priority.  In the following example, &#8220;myplugin&#8221; defines a function that is executed at the &#8220;init&#8221; event:</p>
<p><code>function myplugin_init() {</code><br />
<code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;load_plugin_textdomain('my-plugin');</code><br />
<code>}</code><br />
<code>add_action('init', 'myplugin_init');</code></p>
<h2>Make Good Use of String Formatting</h2>
<p>It&#8217;s easy for native English speakers to forget that other languages don&#8217;t have the same syntax as English.  Let&#8217;s say we want to internationalize output that in English has the form of the following:</p>
<p>&#8220;<code>ERROR Code 102: username is a required field</code>&#8221;</p>
<p>There is a <strong>bad way to do it</strong> (though not uncommon&#8211;this is a lightly modified example from an actual plugin):<br />
<code>$error = __('ERROR Code ','my-plugin') . $code_number . ':' . $field_name . __('is a required field','my-plugin');</code></p>
<p>Here is a <strong>better method</strong>:<br />
<code>$error = sprintf(__('ERROR Code %1$d: %2$s is a required field','my-plugin'),$code_number, $field_name);</code></p>
<p>The first, bad, example chops the sentence into parts, which might not work independently in another language or might confuse the translator viewing a series of cryptic phrases.  As much as possible, try to keep a distinct thought within one localized line.</p>
<p>To do this, the second, good, example above uses PHP&#8217;s formatting function, <a href="http://us3.php.net/sprintf"><code>sprintf</code></a>. Translators would see the line &#8220;<code>ERROR Code %1$d: %2$s is a required field</code>&#8221; and know that wherever in the sentence the numeric error code should appear, they should insert &#8220;<code>%1$d</code>,&#8221; and insert &#8220;<code>%2$s</code>&#8221; wherever the required field string should be.</p>
<h2>Handle plurals correctly</h2>
<p>Sometimes in the case of handling plurals, string formatting does not provide sufficient flexibility.  Let&#8217;s say you need to be able to translate a string like this:</p>
<p><code>3 podcasts available for downloading</code></p>
<p>String formatting won&#8217;t allow you differentiate between the singular &#8220;podcast&#8221; and plural &#8220;podcasts.&#8221;  Instead, you can use <code>__ngettext</code>.  <code>__ngettext</code> accepts four parameters: the singular version of the string, the plural, the actual number, and the text domain.  So we could localize the above example like so:</p>
<p><code>__ngettext('%s podcast available for downloading', '%s podcasts available for downloading', $podcast_count,'my-plugin');</code></p>
<h2>Resolve Ambiguities with Comments</h2>
<p>Sometimes an English word has different meanings depending on its context.  In WordPress, for example, the English word &#8220;editor&#8221; can mean both the user role (someone who has editing capability) and the text-area where one writes a post.  In other languages, those different meanings have different words, so localization needs a way of distinguishing them for a translator.  WordPress&#8217;s <code>_c</code> function allows you to provide that context.  </p>
<p>Use <code>_c</code> just as you would <code>__</code>, except that if you insert a pipe&#8212;i.e. &#8220;<code>|</code>&#8221; &#8212;everything including and following the pipe will be ignored in the output, allowing you to use the pipe to demarcate comments.  The following two lines output the same in English, but the piped comments allow one to present context to the translators.</p>
<p><code>__c('Editor|role');</code><br />
<code>__c('Editor|rich-text textarea');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pressedwords.com/6-tips-for-localizing-your-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/11 queries in 0.004 seconds using memcached
Object Caching 324/362 objects using memcached

 Served from: pressedwords.com @ 2026-04-30 21:01:01 by W3 Total Cache -->