Skip to content

fix: lang() may return false - #7966

Merged
kenjis merged 3 commits into
codeigniter4:developfrom
kenjis:fix-lang-format-error
Oct 5, 2023
Merged

kenjis merged 3 commits into
codeigniter4:developfrom
kenjis:fix-lang-format-error

Conversation

@kenjis

@kenjis kenjis commented Sep 24, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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?

Copy link
Copy Markdown

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
Copy Markdown
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"'

Copy link
Copy Markdown

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
Copy Markdown
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
@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