- Work done on the kinda-micro-framework to allow smoother deployment

This commit is contained in:
mcndave committed 2022-11-29 19:53:41 +00:00
1 parent f719246624
commit aba9a65a3c
14 files changed
+357 -12

No files matched your search

+7 -6
View File
@@ -8,23 +8,24 @@ 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')
get('tell.fallback') /* 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";
$i18n = new Tell\I18n( $c->get(Tell\Reader\JsonReader::class), $c->get(Tell\Reader\PhpReader::class), new Tell\PrintMissingKey() );
$i18n->locale(getenv('DEFAULT_LOCAL_FALLBACK') ?: "en_US");
$i18n->initialize(true);
return $tell;
return $i18n;
},
# 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);
return new Tell\Reader\PhpReader($c->get(Lean\Lean::class)->getI18n('php'), false);
},
Tell\Reader\JsonReader::class => function($c) {
return new Tell\Reader\JsonReader($c->get(Lean\Lean::class)->getI18n('json'), true);
return new Tell\Reader\JsonReader($c->get(Lean\Lean::class)->getI18n('json'), true, \JSON_PRETTY_PRINT);
},
LanguageHandler::class => autowire(LanguageHandler::class),