First of all, you must download our software. Nimrod is a PHP-based internationalization tool, and so it can work as standalone software. However, to make the most of its capabilities, we recommend to use our integration as a Wordpress plugin.
This is a minimum working example to integrate Nimrod on any web page.
<?php
define( 'GETTEXT_LOG_UNTRANSLATED', dirname( __FILE__ ) . '/gettextlogused' );
// Load _gt and _gx functions to augment gettext and gettext+context capabilities.
require 'phplibs/class.nimrod.poutil.php';
require 'phplibs/class.nimrodgettext.php';
// Finally create a function to process the DOM.
function nimrod_parse($buffer) {
NimrodLogger::resetFiles();
$np = new NimrodParser;
$np->loadString($buffer)->parse();
NimrodLogger::addResourceComments($np->resources);
NimrodLogger::save();
return $np;
}
ob_start('nimrod_parse');
// Your page code goes here.
// Use _gt() instead of gettext() or your custom translation function.
// Use _gx() instead of your gettext_with_context function.
ob_end_flush();
?>
With this, whenever a user browse a page, a JSON-formatted log file will be created in the directory defined in GETTEXT_LOG_UNTRANSLATED.
Uncompress the source code in your wp-content/plugins/ directory and activate the plugin through the Plugins section in WordPress. That's it! Then you can access the Nimrod submenu in the Plugins aside menu.
Nimrod is maintained during our spare (and limited) time. Supporting further development does mean that people is really interested in keeping it growing. So please consider donating!