32 lines
929 B
PHP
32 lines
929 B
PHP
<?php
|
|
|
|
use function DI\autowire, DI\create, DI\get;
|
|
|
|
use Notes\Tell\LanguageHandler;
|
|
|
|
return [
|
|
Tell\I18n::class => create( Tell\I18n::class ) ->constructor(
|
|
get(Tell\Reader\JsonReader::class),
|
|
get(Tell\Reader\PhpReader::class),
|
|
getenv("DEBUG") ? create(Tell\PrintMissingKey::class) : get('tell.fallback')
|
|
),
|
|
|
|
'tell.fallback' => function($c) {
|
|
$tell = new Tell\I18n( $c->get(Tell\Reader\PhpReader::class) );
|
|
$tell->locale = "en_US";
|
|
|
|
return $tell;
|
|
},
|
|
|
|
# TODO -- accept folders from Lean Apps
|
|
Tell\Reader\PhpReader::class => function($c) {
|
|
return new Tell\Reader\PhpReader($c->get(Lean\Lean::class)->getI18n('php'), true);
|
|
},
|
|
|
|
Tell\Reader\JsonReader::class => function($c) {
|
|
return new Tell\Reader\JsonReader($c->get(Lean\Lean::class)->getI18n('json'), true);
|
|
},
|
|
|
|
LanguageHandler::class => autowire(LanguageHandler::class),
|
|
];
|