https://github.com/wikimedia/labs-tools-intuition
Mirror of https://gerrit.wikimedia.org/g/labs/tools/intuition
https://github.com/wikimedia/labs-tools-intuition
Last synced: about 2 months ago
JSON representation
Mirror of https://gerrit.wikimedia.org/g/labs/tools/intuition
- Host: GitHub
- URL: https://github.com/wikimedia/labs-tools-intuition
- Owner: wikimedia
- License: mit
- Created: 2012-10-31T04:03:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-04-10T12:07:00.000Z (2 months ago)
- Last Synced: 2025-04-13T07:47:40.854Z (about 2 months ago)
- Language: PHP
- Homepage: https://intuition.toolforge.org
- Size: 13.6 MB
- Stars: 39
- Watchers: 15
- Forks: 31
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS.txt
Awesome Lists containing this project
README
[](https://packagist.org/packages/krinkle/intuition)
# Intuition
**Intuition** is a localisation library for PHP applications. Intuition is designed for use by web applications on Wikimedia Toolforge, but is implemented as a standalone library that is available for any application via its Composer package.
It was originally developed in 2011 for use on [Wikimedia Toolserver](https://meta.wikimedia.org/wiki/Toolserver) (since then replaced by [Toolforge](https://wikitech.wikimedia.org/wiki/Portal:Toolforge)).
> Intuition (INTUI-tion) originally stood for "Internationalization for Toolserver's User Interface".
Intuition supports the _Banana Milkshake_ message file format ([developed](https://github.com/wikimedia/jquery.i18n) for use in MediaWiki). We recommended [translatewiki.net](https://translatewiki.net) for managing translations, which allows contributors to translate and review message via a user-friendly interface, which are then periodically automatically exported in the Banana JSON format to your Git repository.
## Install
It's recommended you use [Composer](https://getcomposer.org).
* Run `composer require krinkle/intuition`.
* Include `vendor/autoload.php` in your program.## Usage
To use it in a tool, read the [Usage documentation](./docs/API.md).
Example:
require_once __DIR__ . '/vendor/autoload.php';$int = new Intuition( 'mytool' );
$int->registerDomain( 'mytool', __DIR__ . '/i18n' );echo $int->msg( 'example' );
## Getting involved
Report issues by [creating a Phabricator task](https://phabricator.wikimedia.org/tag/intuition/).
Code coverage can be found at .
### Testing
Use [Composer](https://getcomposer.org) for managing dependencies (such as [PHPUnit](https://phpunit.de)). Install Composer via your preferred package manager, or from [source](https://getcomposer.org/download/). Some tests also require [Node.js](https://nodejs.org/).
Prior to running tests, ensure presence of development dependencies:
composer installRun the tests:
composer test## See also
* [intuition-web](https://gerrit.wikimedia.org/g/labs/tools/intuition-web): The web interface to Intuition.