Skip to content
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

Language is not merging with modules #1433

Closed
natanfelles opened this issue Nov 8, 2018 · 3 comments
Closed

Language is not merging with modules #1433

natanfelles opened this issue Nov 8, 2018 · 3 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them missing feature Reported issue which is not a bug but needs to be implemented
Milestone

Comments

@natanfelles
Copy link
Contributor

Describe the bug

When a Language file with same name of an default file of the system/Language/en/ is in a module folder, it is not merged.

For example:

I have the following folder structure:

application/
module-x/
module-x/Commands/
module-x/Language/en/

The namespace is proper configured in the Autoload config. I can see the commands when I call the spark.

And the lang() function also works - BUT, if a module lang file has the same name of a default file, it does not works.

If a file is named Foo.php, it works: lang('Foo.hello').

If a file is named HTTP.php, it does not works: lang('HTTP.hello').

Same for others, like Database.php, etc.

CodeIgniter 4 version

4.0.0-alpha.2

Affected module(s)

Language

Expected behavior, and steps to reproduce if appropriate

Expected that module Language files be merged.

Context

  • OS: [Debian]
  • Web server [PHP]
  • PHP version [7.2]
@jim-parry
Copy link
Contributor

jim-parry commented Nov 8, 2018

This is related to #1262; not sure if the resolution of that issue will fix this.
There is also the issue of falling back to parent language ("en") if dialect language ("en-CA") is missing a key.
Further testing & refinement are underway :-/

@natanfelles
Copy link
Contributor Author

natanfelles commented Nov 8, 2018

Hi, @jim-parry !

I think is not related.

Some time ago I also saw that is necessary a fallback and would open an issue, but I found open.

This issue is about files with same name. For some reason it is not merged. It is working just if the filename already is not in use.

I wanted to use the filename Database.php, but does not works. When updated to DB.php works.

This an example

@jim-parry
Copy link
Contributor

They are related in that the expected order of language file loading is not observed.
I am finding a few anomalies between the behaviour described in the user guide and that evident from the code and unit testing :-/
The problem is likely to be made worse with composer-installing the translations.
A few things to fix here, and they can be done one at a time or all at once :)

@jim-parry jim-parry added bug Verified issues on the current code behavior or pull requests that will fix them missing feature Reported issue which is not a bug but needs to be implemented labels Nov 8, 2018
@jim-parry jim-parry modified the milestones: 4.0.0-alpha, 4.0.0 Nov 13, 2018
@natanfelles natanfelles mentioned this issue Dec 5, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them missing feature Reported issue which is not a bug but needs to be implemented
Projects
None yet
Development

No branches or pull requests

2 participants