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

lang: [ar] fix issue #851 #854

Merged
merged 1 commit into from
Sep 24, 2023
Merged

lang: [ar] fix issue #851 #854

merged 1 commit into from
Sep 24, 2023

Conversation

mshannaq
Copy link
Contributor

@mshannaq mshannaq commented Sep 24, 2023

Description
fix #851

number is variable and it should b us as is and not translated. and , comma should be in standard character .

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 lang Languages file label Sep 24, 2023
@datamweb
Copy link
Collaborator

datamweb commented Sep 24, 2023

public function testRegisterUserWhitPwnedValidatorActiveInLangAr(): void
{

$currentLocale = Locale::getDefault();
Locale::setDefault('ar');

$language = Services::language();
$language->setLocale('ar');

$config                      = config('Auth');
$config->passwordValidators  = [PwnedValidator::class];
Factories::injectMock('config', 'Auth', $config);

$this->expectException(TypeError::class);
$this->expectExceptionMessage('Cannot assign bool to property CodeIgniter\Shield\Result::$reason of type ?string');

$result = $this->post('/register', [
    'email'            => 'foo@example.com',
    'username'         => 'foo',
    'password'         => 'testpassword',
    'password_confirm' => 'testpassword',
]);

Locale::setDefault($currentLocale);
    
}

@kenjis, how can I set the defaultLocale = 'ar'?

@kenjis
Copy link
Member

kenjis commented Sep 24, 2023

Try

$language = Services::language();
$language->setLocale($locale);

@datamweb
Copy link
Collaborator

@kenjis Thank you!
It worked well.

@datamweb datamweb merged commit 425a550 into codeigniter4:develop Sep 24, 2023
35 checks passed
@datamweb
Copy link
Collaborator

@mshannaq thank you!

@mshannaq mshannaq deleted the ar-fix branch September 24, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang Languages file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Cannot assign bool to property CodeIgniter\Shield\Result::$reason
3 participants