Documentation
Intuition is a framework to provide internationalization ( i18n ) for tools hosted at Tool Labs.
Intuition (INTUI-tion) stands for "Internationalization for Toolserver's User Interface".
The translation process is managed by translatewiki.net and is nightly synced to Git.
- Include
ToolStart.php
. - Create an instance of the Intuition class and assign it to a variable
$I18N
.
Example:
<?php
require_once '/data/project/intuition/src/Intuition/ToolStart.php';
$I18N = new Intuition( array(
// Name of your (primary) text domain
'domain' => 'mytoolname',
) );
echo $I18N->msg( 'welcome' );
Note: If you need messages from multiple domains, you should not create multiple instances of this class. Instead, use the second argument of msg()
. This class is not a wrapper for one particular domain, it's a wrapper for the entire system and the domain
option merely sets a default domain for the msg
method.
Demo: Check a live working sandbox demo of the above script: demo1.
If you're interested in joining the project as framework collaborator or have questions on how the framework is centrally installed at Tool Labs, contact Krinkle or file an issue.