dust-intl
dust-intl copied to clipboard
support numeric tokens (params prefixed with `v`)
hmm, can you elabore more on this @drewfish?
@caridy the details are in the trello card "support numeric replaces like {0}
"
Is this common for Dust helper libs to do with unnamed params?
If not, then this seems out of the scope of what this package should support. Unnamed params seem less ideal than named params because they would suffer from the same ambiguity as boolean params (e.g., foo('bar', true, true, false, true)
).
I think if this translation of argument index to argument name needs to happen, it should be inside the app code base.
@caridy @ericf what do we want do with this one? We have many developers that use this functionality in our own helper. Example:
"MAKE_YAHOO_YOUR_HP": "Make {0}Yahoo!{1} your homepage"
{@i18n_string _key="MAKE_YAHOO_YOUR_HP" v0="<i class='yhoo-logo Va-m img-sprite TextHidden D-ib'>" v1="</i>" /}
Final output would be:
Make <i class='yhoo-logo Va-m img-sprite TextHidden D-ib'>Yahoo!</i> your homepage
We need to pass this into the string so that translators can format it properly.
/cc @willthai
Last I heard (March 11th) from Rajiv:
I¹m going to see what I can do on our side to maybe pre process the {0}-style placeholders and get back to you.
He was responding to an email where I suggested changing {0}
into {v0}
so that it is still called with {@i18n_string v0=...}
.