Skip to content

Documentation

Timo Tijhof edited this page Sep 12, 2015 · 25 revisions

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.

Usage

  1. Include ToolStart.php.
  2. 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.

Set up

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.

Clone this wiki locally