Skip to content

elusivecodes/FyreLang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FyreLang

FyreLang is a free, open-source language library for PHP.

Table Of Contents

Installation

Using Composer

composer require fyre/lang

In PHP:

use Fyre\Lang\Lang;

Methods

Add Path

Add a language path.

  • $path is the path to add.
  • $prepend is a boolean indicating whether to prepend the file path, and will default to false.
Lang::addPath($path, $prepend);

Clear

Clear all language data.

Lang::clear();

Get

Get a language value.

  • $key is the key to lookup.
  • $data is an array containing data to insert into the language string.
$lang = Lang::get($key, $data);

See the MessageFormatter::formatMessage method for details about message formatting.

Get Default Locale

Get the default locale.

$defaultLocale = Lang::getDefaultLocale();

Get Locale

Get the current locale.

$locale = Lang::getLocale();

Get Paths

Get the paths.

$paths = Lang::getPaths();

Set Default Locale

Set the default locale.

  • $locale is the locale.
Lang::setDefaultLocale($locale);

Remove Path

Remove a path.

  • $path is the path to remove.
$removed = Lang::removePath($path);

Set Locale

Set the current locale.

  • $locale is the locale.
Lang::setLocale($locale);

About

FyreLang is a free, open-source language library for PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages