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

chore: Add test for checking localization parameters are not translated #955

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

paulbalandan
Copy link
Member

Description
See #954 (comment)

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

@paulbalandan paulbalandan force-pushed the localization-parameters branch from 677c8a8 to 1056c3a Compare November 20, 2023 06:31
Copy link
Collaborator

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

This is what I wanted, it works fine on local.

There was 1 failure:

1) Tests\Language\UkrainianTranslationTest::testAllLocalizationParametersAreNotTranslated with data set "uk" ('uk')
Failed asserting that parameters of translation keys are not translated:
  * Auth.errorPasswordLength => {0, number}
  * Auth.errorPasswordPwned => {1, number}
  * Auth.errorPasswordTooLongBytes => {param}
Failed asserting that an array is empty.

P:\MyGitHubWork\shield\tests\Language\AbstractTranslationTestCase.php:348

@paulbalandan , thank you for doing it.

@paulbalandan
Copy link
Member Author

I just realized this may not work if a key has several parameters. I'll fix it tomorrow.

Copy link
Collaborator

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

Excellent. Thank you.

18) Tests\Language\FarsiTranslationTest::testAllLocalizationParametersAreNotTranslated with data set "fa" ('fa')
Failed asserting that parameters of translation keys are not translated:
  * Auth.throttled => {1}
  * Auth.unknownAuthenticator => {1, number}, {2, number}, {3, number}
Failed asserting that an array is empty.

@datamweb datamweb requested a review from kenjis November 22, 2023 01:25
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

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

LGTM!

@kenjis kenjis merged commit cecec67 into codeigniter4:develop Dec 2, 2023
@kenjis kenjis changed the title Add test for checking localization parameters are not translated chore: Add test for checking localization parameters are not translated Dec 2, 2023
@paulbalandan paulbalandan deleted the localization-parameters branch December 5, 2023 08:12
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.

3 participants