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

fix: lang() may return false #7966

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 24, 2023

Description
See codeigniter4/shield#851

  • fix Language::formatMessage()
  • add lang item Language.invalidMessageFormat

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Sep 24, 2023

$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
'Invalid message format: "تم الكشف عن كلمة المرور {0} بسبب اختراق البيانات وشوهدت {1 ، عدد} مرة في {2} في كلمات المرور المخترقة.", args: "password,hits,wording"'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this normal (language) for tests?

Choose a reason for hiding this comment

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

Yes it might be better to make a comment as to explain testing of Arabic as international languages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Set locale to ar.


$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage(
'Invalid message format: "تم الكشف عن كلمة المرور {0} بسبب اختراق البيانات وشوهدت {1 ، عدد} مرة في {2} في كلمات المرور المخترقة.", args: "password,hits,wording"'

Choose a reason for hiding this comment

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

Requesting comment for test language

* the LICENSE file that was distributed with this source code.
*/

// "Language" language settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// "Language" language settings

I don't think it is necessary.

@kenjis kenjis merged commit c27fb5d into codeigniter4:develop Oct 5, 2023
64 checks passed
@kenjis kenjis deleted the fix-lang-format-error branch October 5, 2023 00:42
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants