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

Ability to customize interpolation prefix/suffix #4726

Open
zleight1 opened this issue Apr 15, 2024 · 1 comment · May be fixed by #4727
Open

Ability to customize interpolation prefix/suffix #4726

zleight1 opened this issue Apr 15, 2024 · 1 comment · May be fixed by #4727

Comments

@zleight1
Copy link

zleight1 commented Apr 15, 2024

Is your feature request related to a problem? Please describe.

We use i18next (vue-i18next + react, etc.) and the default interpolation uses double braces {{ param }}.

While we can set the interpolation on i18next to use singles braces like vee-validate, this leads to confusion as any documentation or examples online are going to use double braces.

Also, theoretically we could only use single braces for texts that feed into vee-validate, but again this is mixing and inevitably leads to issues down the road. We also have a mix of React and Vue so there would be inconsistency amongst projects (micro-frontends).

Describe the solution you'd like

The ability to customize the interpolation, at minimum to allow double braces but ideally for flexibility it could take any pattern to align with other standards.

Describe alternatives you've considered

Described in the feature request, but generally setting the other libraries to single braces or mixing.

@zleight1
Copy link
Author

I'm going to attempt to implement this myself, it looks like this would just be an option to the constructor and then it'd be passed down through all calls to interpolate.

zleight1 added a commit to zleight1/vee-validate that referenced this issue Apr 15, 2024
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
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 a pull request may close this issue.

1 participant