_e(‘Plugin Name’, ‘text-domain’); ?> Defines which theme owns the translation-ready text and tells the GetText utility to return the translations only from the dictionary supplied with that name.
_e('Plugin Name', 'startbox'); ?> Use a unique identifier here so you don’t conflict with other language libraries in your WordPress installation. Use dashes, not underscores.
the text domain in your Theme Functions file. This tells WordPress where your theme stores the language files and what the text domain for your theme is.
not place PHP variables inside a translation function (Thanks Otto!) Not this: $string = __("You have $number tacos", 'plugin- domain'); ! Do this: $string = sprintf( __('You have %d tacos', 'plugin-domain'), $number );
relies on looking up strings in a table and then translating them. The list of strings to be translated is built by an automated process. Some code scans your PHP code, without executing it, and pulls out all the __()’s it finds, then builds the list of strings to be translated. That scanning code cannot possibly know what is inside $string.
not put HTML markup inside your GetText functions. Translators should not have the ability to change your markup. Not this: <?php _e('<h2>WordSesh</h2>', 'text-domain'); ?> ! Do this: <h2><?php _e('WordSesh','text-domain'); ?></h2>
your plurals! Use the _n function for this - it will use first string if the $number (third parameter to _n) is one, or the second one if it’s more than one. ! $string = sprintf( _n('You have %d beer.', 'You have %d beers.', $number, 'plugin-domain'), $number );
international date formats by allowing users to set their own formats in Settings-->General in their Dashboard. Not this: the_time('F j, Y'); ! Do this: the_time( get_option('date_format') )
Fonts and other font packs Not all font packs are made equal. Some do not support cyrillic languages (Russian, Japanese, etc) or languages with western european characters (Polish, etc). !
(Right to Left) Support is_rtl(); Checks if current locale is RTL. if ( is_rtl() ) { wp_enqueue_style('rtl', get_stylesheet_directory_uri().'/css/ rtl.css'); } !
(Right to Left) Support - CSS ! Go through your CSS line by line to create RTL support for each selector. ! Some hints: http://codex.wordpress.org/Right-to- Left_Language_Support !
(Right to Left) Support - Testing RTL Tester This plugin adds a button to the admin bar that allow super admins to switch the text direction of the site. It can be used to test WordPress themes and plugins with Right To Left (RTL) text direction. http://wordpress.org/plugins/rtl-tester/ !