-
Notifications
You must be signed in to change notification settings - Fork 42
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
Breaking: Remove support for mode=json #53
Comments
Hi @aredridel, Thx! |
mode=paired probably should be too: what people usually use it for is lists of states and countries, which really can just live in a template. |
What makes json a more important target though is that it can't work right -- the quoting rules require more context sensitivity than dust can use, and is just a source of bugs -- possibly security affecting ones. |
I agree with you regarding the quoting rules problems but mode=paired/json can be useful with the provide helper. You can use it to build multiple views (multiple pages) sharing one dust partial. Thus, you can pass the view-related i18n content to the dust partial. |
Yeah. I think there are better, simpler, less complicated ways to do those things. And with json in particular, it'll work until it doesn't. And the failure won't be obvious -- it'll be a parse error in the middle of transient state. Extremely hard to debug. I'd suggest repeating oneself a bit more often instead of introducing that complexity. |
A good way could be to keep the mode=paired/json with the @message helper directly and pushing the i18n content into the helper body context (thus not rendering it): To iterate over i18n keys:
To inject i18n keys in a partial dust template:
Note: The varName parameter describes the namespace for storing the injected i18n content into @message body context. |
I think we can eliminate the feature entirely: It's used seldom and when it's used, it's mostly abused. Quoting takes more contextual awareness than a dust helper can give.
The text was updated successfully, but these errors were encountered: