library language
Gephart Language Component
gephart/language
Gephart Language Component
- Tuesday, April 3, 2018
- by MichalKatuscak
- Repository
- 1 Watchers
- 0 Stars
- 257 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 3 % Grown
Gephart Language
, (*1)
Dependencies
- PHP >= 7.1
- gephart/configuration = 0.4.*
- gephart/dependency-injection = 0.4.*
Instalation
composer require gephart/language
Using
config/language.json, (*2)
{
"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