Skip to content

Conversation

@codingdna2
Copy link
Contributor

This PR includes previous modifications proposed in PR #108, adding a Pluralization service implemented with Humanizer package.

@codingdna2
Copy link
Contributor Author

A side note. I've included a reference to Humanizer.Core which includes only the English localization. I suppose it's enough for most scenarios. You can decide to include Humanizer package instead, which includes all the languages availables (but I've no idea if all of them implements pluralization).

Best Regards,
D.

@tonysneed
Copy link
Contributor

@ErikEJ Thanks for reviewing!

@codingdna2 Couple of questions / requests:

  • What happens if non-English language is specified but not supported by Humanizer.Core? Will it revert to strings instead of nameof?
  • Would you be able to separate commits for this PR from your other PR? The easiest is to use Visual Studio.
    • View branches in the Team Explorer and view history for your Pluralization branch.
    • Right-click commit aa593dc1 and select New Branch. Name the branch: @fix/data-annotation. Select Checkout branch.
    • Go back to the history of your Pluralization branch, select the following commits one at a time and select Cherry-Pick from the context menu. These will be copied to your new data-annotation branch.
    • Repeat this process to create a @fix/pluralization branch from aa593dc1 with commits 2fdb4f7 and 2006079 cherry-picked.
    • Then push each of the new branches to create two new PR's, which will take the place of your old PR's.
  • Thanks for updating the ExpectedXXX classes. Would you be able to add a unit test for the pluralization option?

@tonysneed tonysneed added the enhancement New feature or request label Apr 28, 2020
@codingdna2
Copy link
Contributor Author

  • What happens if non-English language is specified but not supported by Humanizer.Core? Will it revert to strings instead of nameof?

Two questions here:

  1. In case word is not recognized I'm not sure of the behavior, I guess it can happen two things, it gets confused or leave it like it is. There's no language detection, it's just selection of the right vocabulary. I've looked at the documentation but it's not clear and code is quite wide to dive into. I'll have a look again.
  2. If there are no problem in generating nameof (no conflicts, no compiler error in sight), it'll still use nameof.
  • Would you be able to separate commits for this PR from your other PR? The easiest is to use Visual Studio.

I guess is not a problem. Be aware that I'll need to remove the usage of nameof from ExpectedXXX (leaving, if you merge both PRs, with non-runinng tests).

  • Thanks for updating the ExpectedXXX classes.

You're welcome!

Would you be able to add a unit test for the pluralization option?

The unit tests are already running with pluralization by default (all the collections are plural). I see it requires quite a lot of effort to split them all to have both singular and plural tests. I need more time.

All in all, it would be easier if you can accept the first PR shortly (as is bugfix), so I can do a merge on the second PR with calm (as is enhancement). But I'll do what you prefer ;)

Regards,
D.

@tonysneed
Copy link
Contributor

I’ll be glad to merge #108 first. The problem is that you did not create a separate branch for the PR. In this case I advise you rename your fork, then refork my repo, so that your master branch matches mine.

For some guidance on creating a PR, please refer to the Contributing Guidelines.

@codingdna2
Copy link
Contributor Author

Ahahah I didn't notice up now. I guess this is what happens when you work from home while looking at your 4 years old daughter (or late night while she's sleeping)... I'll fix everything asap.

@tonysneed
Copy link
Contributor

@codingdna2 Did you rename your fork, then refork my repo? That should give you the cleanest starting point.

@codingdna2
Copy link
Contributor Author

codingdna2 commented Apr 30, 2020

I've practiced and failed! I moved my modifications to @fix/pluralization but the merge complicated the squash... I guess I'm going to refork and move modifications manually.

@codingdna2 codingdna2 closed this Apr 30, 2020
@tonysneed
Copy link
Contributor

@codingdna2 When you re-fork, remember to create a separate branch, according to the Contributing Guidelines.

@codingdna2
Copy link
Contributor Author

Almost completed including the separated tests.

@tonysneed tonysneed changed the title Pluralization implementation using Humanizer [Deprecated] Pluralization implementation using Humanizer Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants