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

French: added translated color for french language #466

Merged
merged 13 commits into from
Jun 9, 2022

Conversation

RSickenberg
Copy link

What is the reason for this PR?

  • A new feature
  • Fixed an issue (resolve #ID)

Author's checklist

Summary of changes

I simply added a list of colors we use in french.

Review checklist

  • All checks have passed
  • Changes are approved by maintainer

src/Faker/Calculator/Isbn.php Outdated Show resolved Hide resolved
src/Faker/UniqueGenerator.php Outdated Show resolved Hide resolved
@pimjansen
Copy link

Cant these classes all extend from FR_fr to remove duplication?

@RSickenberg
Copy link
Author

Good point @pimjansen will do!

@RSickenberg
Copy link
Author

@pimjansen Let me know if it's ok for you. I used fr_CH by default because it's my IRL locale 😁 but I can change it.

@pimjansen
Copy link

@pimjansen Let me know if it's ok for you. I used fr_CH by default because it's my IRL locale 😁 but I can change it.

Lets use FR_fr instead since its the base locale for it

@RSickenberg
Copy link
Author

@pimjansen Done!

src/Faker/Calculator/Isbn.php Outdated Show resolved Hide resolved
src/Faker/UniqueGenerator.php Outdated Show resolved Hide resolved
@pimjansen
Copy link

PR looks ok besides the two mentioned topics

src/Faker/Calculator/Isbn.php Outdated Show resolved Hide resolved
src/Faker/UniqueGenerator.php Outdated Show resolved Hide resolved
@RSickenberg
Copy link
Author

@pimjansen Done!

Please, note it was due to the CS linter ran with PHP 8.1.4, it sure is off topic but you may like to checks this 😄

@pimjansen
Copy link

@pimjansen Done!

Please, note it was due to the CS linter ran with PHP 8.1.4, it sure is off topic but you may like to checks this 😄

It should be executed with the lowest supported php version in the scripts (see workflows). This due support for older versions and thus syntax that can change over time

@pimjansen
Copy link

One last thing i did not mentioned earlier (sorry for that though its in the guide). Please ensure the new code is covered by unittests

@RSickenberg
Copy link
Author

RSickenberg commented Apr 1, 2022

@pimjansen Do you want me to test an array? That's not even testable 🥲. First time I truly contribute to an open-source project, now I understand why most devs won't do this in their career. (sorry for that though, that's my feeling)

Here, a simple test: 9cd51d8

@pimjansen
Copy link

Sorry that you feel this way! But as mentioned in the contribution guide which you manually checked it states:

  • Your code should be covered by unit tests.

Since this is mandatory in libraries used all over the place. The test now actually is testing is something is a string which actually does not test much. Faker works with seeding so please assert an actual value from the seed so we can ensure this does not change. You might think that you are just testing an array value but there could actually be quite some logic behind it.

This test is both for the safeColor as allColor methods from the Faker Generator

@RSickenberg
Copy link
Author

RSickenberg commented Apr 1, 2022

@pimjansen That's ok, it's more a question of "how" than "why/what".

Can you provide me an example (or something similar) where I can see how to seed?

Since it's color, I don't have many methods to parse all the array, I only have string with faker->colorName() or faker->safeColorName()

@bram-pkg
Copy link
Member

bram-pkg commented Apr 1, 2022

Seeding is done automatically in the base test class. Look at this test for example: https://github.com/FakerPHP/Faker/blob/main/test/Faker/Core/DateTimeTest.php

@RSickenberg
Copy link
Author

So, @bram-pkg my tests are ok?

@bram-pkg
Copy link
Member

bram-pkg commented Apr 4, 2022

Not quite, make sure to compare them against the output of your function. Since it's being seeded, it will always be the same.

@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

@RSickenberg
Copy link
Author

Don't. I will find time to write those tests

@stale stale bot removed the lifecycle/stale label Apr 19, 2022
@RSickenberg
Copy link
Author

Honestly @bram-pkg and @pimjansen, I don't quite understand. I didn't even write some functions in this PR. I only translated some strings.

Can you pin me exactly what did you expect? The DateTimeTest you sent me is not relevant since I don't know what to look at.

@pimjansen
Copy link

Honestly @bram-pkg and @pimjansen, I don't quite understand. I didn't even write some functions in this PR. I only translated some strings.

Can you pin me exactly what did you expect? The DateTimeTest you sent me is not relevant since I don't know what to look at.

We are changing the dataset so we want to ensure it stays intact and does what expected. You now added some regex to see if its a valid string which on its own is fine.

Since Faker is using seeding it means that a testcase always returns the same result.

Therefor i suggest to test an actual value of the generator. In your case assert that the generator returns the value which is returned while calling it with a specific seed.

@pimjansen
Copy link

@RSickenberg can you allow us to make changes to your PR to finish it?

@RSickenberg
Copy link
Author

RSickenberg commented May 11, 2022

@RSickenberg can you allow us to make changes to your PR to finish it?

@pimjansen Sure, please do. I don't have time to contribute yet 😔

@pimjansen
Copy link

@RSickenberg can you allow us to make changes to your PR to finish it?

@pimjansen Sure, please do. I don't have time to contribute yet 😔

You have to allow this since i cant at this moment

@RSickenberg
Copy link
Author

@RSickenberg can you allow us to make changes to your PR to finish it?

@pimjansen Sure, please do. I don't have time to contribute yet 😔

You have to allow this since i cant at this moment

image
It's already on 🤔

@stale
Copy link

stale bot commented Jun 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale label Jun 4, 2022
@RSickenberg
Copy link
Author

@pimjansen Any updates ?

@stale stale bot removed the lifecycle/stale label Jun 9, 2022
@pimjansen pimjansen merged commit 109d5bf into FakerPHP:main Jun 9, 2022
@RSickenberg
Copy link
Author

Thank you @pimjansen ❤️.

@pimjansen
Copy link

Thank you @pimjansen ❤️.

Is it clear for you how the seeding works now and the diff i did in the test?

@RSickenberg
Copy link
Author

@pimjansen Yup, not gonna lie, I thought the call was about to return random choices instead of the one asserted.

@pimjansen
Copy link

@pimjansen Yup, not gonna lie, I thought the call was about to return random choices instead of the one asserted.

No worries, now you know for the future 😋

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.

None yet

4 participants