Description
Describe the bug
The documentation says that when using composer and requiring codeigniter4/translations
, the translations should be automatically picked up and that there is no need to copy them to the app
directory.
This does not currently work unfortunately.
CodeIgniter 4 version
4.0.0-beta4
Affected module(s)
language, autoloader
Expected behavior, and steps to reproduce if appropriate
- Make new composer installation and require
codeigniter4/translations
- Set default locale to anything other than English
- In the demo controller, try for example
var_dump(lang('Validation.noRuleSets'))
- It will display the English message.
The cause is that the Language module tries to look up the file Language/{$locale}/{$file}.php
, but the translations
composer repository registers the Translations
namespace as the Language
directory, which means that codeigniter will try to look for Translations/Language/{$locale}/{$file}.php
in the package. The correct file would be Translations/{$locale}{$file}.php
. Adjusting the path that is looked up to {$locale}/${file}.php
does allow it to work, but it breaks the look-up inside the application and is of course not the real solution (no idea how to solve this cleanly).
Context
- OS: Linux
- Web server lighttpd 1.4.54
- PHP version 7.3.6
Activity