Skip to content

Repository files navigation

Dictionary

Build StatusLatest Stable VersionTotal DownloadsLicense

Localization and text management library for PHP.

Requirements

This library uses PHP 5.4+.

Installation

It is recommended that you install the Dictionary library through composer. To do so, add the following lines to your composer.json file.

{
"require": {
"sinergi/dictionary": "dev-master"
}
}

Usage

Setup the Dictionary class with the path to your text files:

useSinergi\Dictionary\Dictionary;
$language = 'en';
$directory = __DIR__ . "/examples";
$dictionary = newDictionary(
$language,
$directory
);

You can then use the dictionary like this:

$dictionary['example']['title'];

Examples

See more examples in the examples folder.

Example of a dictionary file:

return [
'title' => "This is an example"
];

About

Localization and text management library for PHP

Resources

Stars

15 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages