Closed willthai closed 10 years ago
/cc @drewfish
Would something like this work instead?
{@img src="{asseturl}" alt="{@i18n _key='ALT_TEXT'}" /}
@drewfish afaik, a dust helper inside a dust helper doesn't work
It seems like you could use a helper that puts the results of part of the template into a variable in the context. I searched a little bit for a helper to do this but couldn't find one. (BTW, there's nothing intl-specific about this.)
I was able to hack together a helper that works with the dustjs-linkedin
version of dust:
Dust.helpers.export = function(chunk, context, bodies, params) {
return chunk.capture(bodies.block, context, function(out, chunk2) {
context.current()[params.to] = out;
chunk2.end('');
});
};
You can then use it like {@export to="foo"}I like {color} balloons.{/export}...{foo}
and {color:'red'}
which should return ...I like red balloons.
. In your case case you'd do something like {@export to="altText"}{@i18n _key='ALT_TEXT'}{/export}{@img src=asseturl alt=altText /}
.
closing this issue since it is not intl specific.
I have a use case as such:
{@i18n_string _key="ALT_TEXT" _name="altText"} {@img src="{asseturl}" alt="{altText}" /} {/i18n_string}
Can I get this supported? Thanks