-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(i18n): allow custom interpolation options for i18n #4727
base: main
Are you sure you want to change the base?
Conversation
Allow for specifying custom interpolation options for i18n. This is useful for custom interpolation patterns, such as `{{` and `}}`. Tests added, and scoped to the i18n module. Closes logaretm#4726
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4727 +/- ##
==========================================
+ Coverage 89.87% 89.89% +0.01%
==========================================
Files 93 93
Lines 7676 7709 +33
Branches 1360 1362 +2
==========================================
+ Hits 6899 6930 +31
- Misses 770 772 +2
Partials 7 7 ☔ View full report in Codecov by Sentry. |
If accepted I'll update the docs as well |
@logaretm - is there something I can do to help with making this a reality? If there's some reason you would not want this, please let me know why so I can understand more. Thanks! |
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.
Sorry for the delay, Thank you @zleight1, This looks alright to me. I have no concerns here other than the test file seems to have changed significantly. I would have assumed this would need to add a test case or two but the changes here are too significant with some tests altered, if possible lets keep everything as-is and only add the needed test cases for this interpolation feature.
Once that is fixed we can merge this right away.
@@ -4,58 +4,59 @@ import { required, between } from '@/rules'; | |||
import { localize, setLocale } from '@/i18n'; | |||
import { mountWithHoc, setValue, flushPromises } from '../../vee-validate/tests/helpers'; | |||
|
|||
defineRule('required', required); |
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.
Too many changes here, maybe due to having describe
? If so then lets revert that and only include the test cases for this PR.
Allow for specifying custom interpolation options for i18n. This is useful for custom interpolation patterns, such as
{{
and}}
. Tests added, and scoped to the i18n module.Closes #4726
🔎 Overview
Adds the ability to use custom interpolation options, such as prefix and suffix.
This allows the library to comply with the default i18next standard.
🤓 Code snippets/examples (if applicable)
✔ Issues affected
closes #4726