Closed manageruz closed 3 years ago
Last loaded lang files from Myth namespace have precedence over earlier one.
have you tried to call the language file like this : lang('Auth.yourKey')
? I mean, before [dot] you're using CamelCase.
EDIT : Long time ago I had a problem to call the language file while in live server, and the problem solver is very simple : I must correct the file name (it use CamelCase, UPPERCASE or undercase)
have you tried to call the language file like this :
lang('Auth.yourKey')
? I mean, before [dot] you're using CamelCase.
Of course. With it there is no problem.
That's weird.. have you tried to delete the MythAuth lang? I mean just write the lang only at app/Lang
That's weird.. have you tried to delete the MythAuth lang? I mean just write the lang only at app/Lang
Yes. If we delete lang files from Myth-auth folder, then framework return right lang text (which is inside app/language folder).
I continued to study the code and found that if the myth-auth put to the root of the framework (not inside app/third_party), then the language files works as intended. But if we move files from root folder to app/third_party for example, then we got the problem.
Language
prioritizes the App
namespace, but that would include anything in App
(like Third Party) so by moving it out of the app/ folder altogether you lower it's priority.
Language
prioritizes theApp
namespace, but that would include anything inApp
(like Third Party) so by moving it out of the app/ folder altogether you lower it's priority.
Thanks for the info. It would be great to include this info to the framework's documentation too.
Feel free to make a PR to the framework repo's user_guide/ folder. We already have a note about prioritizing App
files, I think this is just an accident. Our File Locator matches on the root path: https://github.com/codeigniter4/CodeIgniter4/blob/aff1f3af17919e06e5cec264a4c83043ea619ab4/system/Autoloader/FileLocator.php#L182
... which means anything in the app/ folder will get priority.
Hello everyone. In myth auth even if i save the Auth.php lang file inside App/language folder, framework loads both files (inside app/language and inside ThirdParty/myth-auth/language folder). And lang file loaded inside myth-auth have precedence. So all your modified parts in lang file become unusable. How to solve it? Thanks in advance.
PHP: 7.3.11 — CodeIgniter: 4.1.4