Skip to content

Fix lang() function overriding default locale in Language class - #5001

Merged
MGatner merged 1 commit into
codeigniter4:4.2from
pjsde:fix_lang_function
Aug 17, 2021
Merged

MGatner merged 1 commit into
codeigniter4:4.2from
pjsde:fix_lang_function

Conversation

@pjsde

@pjsde pjsde commented Aug 14, 2021

Copy link
Copy Markdown
Contributor

After using the lang() function with the $locale parameter filled in, it overrides the default locale in the Language class, which shouldn't happen, because when using the lang() function with the $locale parameter it should be just for that call.

With this change, this override is corrected and the locale that was previously selected is restored.

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@MGatner MGatner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for changing that. There are a few style issues but this whole branch needs to be run through CS Fixer once it is ready so not a big deal - just mind it for the future.

@MGatner
MGatner merged commit 32e0afd into codeigniter4:4.2 Aug 17, 2021
@pjsde
pjsde deleted the fix_lang_function branch June 16, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants