In general, if you want to have control over those arguments, reusing the 
template without the need of the wrapping function, you will have to provide a 
way to apply logic inside the template string, that complicates things a lot.

As for i18n, ICU messages can solve that part of the puzzle providing structure 
and logic for complex messages. FYI we are working on a proposal for ECMA-402 
to introduce `Intl.MessageFormat()` that will address i18n aspect of this.

/caridy

> On Mar 23, 2015, at 4:52 PM, Andrea Giammarchi <[email protected]> 
> wrote:
> 
> Even a function wouldn't scale that well for i18n purpose, 'cause you should 
> write either a function per language or each language switch statement per 
> function.
> 
> I see current ES6 string templates good for debug purpose only, and not much 
> else ... maybe English centric developers tools so few, definitively good use 
> cases, but nothing that useful or powerful for the known Web.
> 
> ```
> 
> var template = ``Hello ${name} !``;
> 
> template({name: 'there'}); // Hello there !
> 
> ```
> 
> But I know, double back-tick might look too like double rainbow: "OMG what 
> does it mean" ??!
> 
> Regards
> 
> 
> 
> On Mon, Mar 23, 2015 at 9:29 PM, Brendan Eich <[email protected] 
> <mailto:[email protected]>> wrote:
> Jason Orendorff wrote:
> But from the few data points I have, approximately 100% of web
> developers, when they first hear "template strings are in ES6", think
> that means something like Mustache in the standard library. Some
> initially try to use the feature that way and get frustrated. I expect
> widespread confusion on this point.
> 
> This.
> 
> A function wrapped around a template string, where the function's parameters 
> occur in embedded expressions, goes a long way. But you have to write the 
> function, after teaching people the basics and apologizing for misleading 
> them with the t-word.
> 
> /be
> 
> _______________________________________________
> es-discuss mailing list
> [email protected] <mailto:[email protected]>
> https://mail.mozilla.org/listinfo/es-discuss 
> <https://mail.mozilla.org/listinfo/es-discuss>
> 
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to