Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TutsPlus.com:
Internationalizing WordPress Projects: A Practical Example, Part 1
Jul 06, 2016 @ 15:50:43

Tom McFarlin has continued his series covering internationalization in WordPress applications with this latest part of the series. In the previous part of the series he introduced some of the basic topics and terms. In this new tutorial he gets more into functionality creating the plugin he'll use in his examples.

Given that WordPress powers roughly 25% of the web and that the web is not local to your country of origin, it makes sense to ensure that the work that we produce can be translated into other locations.

To be clear, this does not mean that you, as the developer, are responsible for translating all of the strings in your codebase into the various languages that your customers may use. Instead, it means that you use the proper APIs to ensure someone else can come along and provide translations for them.

He then walks you through the download of the latest WordPress version (a Subversion checkout) and the creation of the plugin structure. He provides sample code to define the plugin and shows how it should look in the "Plugins" listing. He helps you add in the menu item with internationalized strings for the link text. They help you add a simple screen for the plugin and help you style the page a bit. The post ends with a brief mention of object-oriented programming but points out that OOP introduces other, not necessarily related, topics that could detract from the WordPress-related content (and so will not be used).

tagged: wordpress internationalization i18n tutorial series part2 plugin example practical

Link: http://code.tutsplus.com/tutorials/internationalizing-wordpress-projects-a-practical-example-part-1--cms-26676


Trending Topics: