-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translations are not loaded from composer repository #2120
Comments
oops! I cn fix this next week, when I am vack from vacation :-/ |
Corrected the composer autoload config in the translations repo. |
Unfortunately, composer version 4.0.0-beta.4 does not seem to contain the fix. I think you may have released the wrong commit? |
Hmm - I see that. I re-released beta.4, but the binaries were not updated. |
Not hearing anything contrary in 4 days, I presume the fix works. |
No, it does not seem to work. As far as I can tell, the namespace you put into the composer.json is irrelevant for the lookup actually. Did it work on your end? |
Gah - I thought it worked for me. WIll recheck :-/ |
Finally nailed this, as far as I can tell. |
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 theapp
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
codeigniter4/translations
var_dump(lang('Validation.noRuleSets'))
The cause is that the Language module tries to look up the file
Language/{$locale}/{$file}.php
, but thetranslations
composer repository registers theTranslations
namespace as theLanguage
directory, which means that codeigniter will try to look forTranslations/Language/{$locale}/{$file}.php
in the package. The correct file would beTranslations/{$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
The text was updated successfully, but these errors were encountered: