Add Internationalization

- Add Utils/L10n class
- Add translator functions to PHP Renderer
- Refactor web controllers to prevent duplicated code
- Add locale middleware
- Add translation file loading
- Add i18n settings
This commit is contained in:
Hypolite Petovan 2018-11-15 23:59:00 -05:00
commit 5b7bb030de
21 changed files with 537 additions and 245 deletions

View file

@ -18,6 +18,11 @@ if (\is_readable(__DIR__ . '/../config/local.json')) {
$settings = [
'displayErrorDetails' => false, // set to false in production
'addContentLengthHeader' => false, // Allow the web server to send the content-length header
'i18n' => [
'locales' => ['en', 'fr'],
'default' => 'en',
'path' => __DIR__ . '/lang'
],
// Escaper settings
'escaper' => [
'encoding' => 'utf-8'