gephart/language

Gephart Language Component

0.5 2017-10-13 10:30 UTC

This package is not auto-updated.

Last update: 2024-02-18 21:02:25 UTC


README

Build Status

Dependencies

  • PHP >= 7.1
  • gephart/configuration = 0.4.*
  • gephart/dependency-injection = 0.4.*

Instalation

composer require gephart/language

Using

config/language.json

{
  "fallback": "cs"
}
$container = new \Gephart\DependencyInjection\Container();

/** @var \Gephart\Configuration\Configuration $configuration */
$configuration = $container->get(\Gephart\Configuration\Configuration::class);
$configuration->setDirectory(__DIR__ . "/config");

$language = $container->get(\Gephart\Language\Language::class);

echo $language->get(); // cs (fallback)

$language->set("en");
echo $language->get(); // en