-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
Add constructor option for custom modifiers #724
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #724 +/- ##
==========================================
+ Coverage 96.25% 96.26% +0.01%
==========================================
Files 10 10
Lines 800 803 +3
==========================================
+ Hits 770 773 +3
Misses 30 30
Continue to review full report at Codecov.
|
Great enhancement 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR!
That's awesome features!
We need the docs to use it.
Could you add the documentation, please? 🙏
I added documentation for English. I hope I did it correctly, as I found some documentation under vuepress and some under gitbook. Is the second one still maintained? Unfortunately I can't do the Chinese translations 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR adds the possibility to pass custom modifiers when creating a i18n object. It extends the functionality of #467 and the
lower
andupper
modifiers (also called also formatters previously in the code) with whatever the user needs are.My use case is similar to #513, since I need to sometimes capitalize my linked translation. I believe that giving the ability of extending the modifiers is the best way to go, as the need for modifier functions can be endless and doesn't make sense to support everything by default in the library.