

Do the same again but this time enter “_e” Then enter two underscores “_” and click in the empty space in the dialog box, so the system assume it. click the tab “Keywords) (the 3rd tab), and in the icon buttons click “new entry” (wait for the tooltip to know for sure). Then in the icon buttons click “new entry” (wait for the tooltip to know for sure), enter dot “.” (without the parenthesis “” of course), and click in the empty space in the dialog box, so the system assume it.ĥ. Still on the same dialog box, click the tab “Paths” (the 2nd tab), and enter the path where your php files are, so the library know where to scan for translations. DO NOT enter anything else, especially the country, or your plugin will by country dependent instead of language dependent.Ĥ. On the new opened dialog box, enter the name of your project, the team’s (your) name, your e-mail, the language, and the encoding. Open POEDIT: On the top menu click: file > new catalog (terms may vary, depending on the language of your POEDIT)ģ.

To fetch a string simply use _('String name','your-unique-name') to return the translation or _e('String name','your-unique-name') to echo the translation. $locale_file = TEMPLATEPATH."/languages/$locale.php" Īdd this to your php files that need translation: Load_theme_textdomain( 'your-unique-name', TEMPLATEPATH.'/languages' )

POEDIT TUTORIAL WORDPRESS CODE
– Add this code to your theme’s functions.php: Load_plugin_textdomain( 'your-unique-name', false, 'your-unique-name/languages' ) This is what you need to add to the Plugin or Theme’s code to make sure the language file(s) are loaded: For plugins:Īdd_action( 'init', 'your-unique-function' ) Please note that language files for Plugins IS NOT automatically loaded. WordPress is used all around the world, so it has internationalization and localization built into its structure, including localization of Plugins.
POEDIT TUTORIAL WORDPRESS SOFTWARE
Internationalization is the process of setting up software so that it can be localized localization is the process of translating text displayed by the software into different languages. Once you have the programming for your theme, plugin or widget done, another consideration is internationalization. This was the main purpose of this article. po files but very little about creating your own. I found there is a lot information on the web about editing. po library (catalog) files for any purpose, not just WP po creation method using poedit is “roughly” universal, thus this post can be used as an universal tutorial about creating. This article is about creating language translations for word press developments, both for plugins and themes.
