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:
parent
13a2068a8b
commit
5b7bb030de
21 changed files with 537 additions and 245 deletions
|
|
@ -5,9 +5,9 @@ use Interop\Container\ContainerInterface;
|
|||
// DIC configuration
|
||||
|
||||
// l10n
|
||||
$container['l10n'] = function (ContainerInterface $c): Friendica\Directory\Content\L10n {
|
||||
$settings = $c->get('settings')['l10n'];
|
||||
return new Friendica\Directory\Content\L10n($settings['language'] ?: 'en', $settings['lang_path'] ?: '');
|
||||
$container['l10n'] = function (ContainerInterface $c): Gettext\TranslatorInterface {
|
||||
$translator = new Gettext\Translator();
|
||||
return $translator;
|
||||
};
|
||||
|
||||
// simple cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue