Skip to content

feat(__): added tagged template literal support#44

Merged
bcoe merged 2 commits intoyargs:masterfrom
zkat:master
May 17, 2017
Merged

feat(__): added tagged template literal support#44
bcoe merged 2 commits intoyargs:masterfrom
zkat:master

Conversation

@zkat
Copy link
Copy Markdown
Contributor

@zkat zkat commented May 14, 2017

This is a nice little convenience wrapper for those of us with template literals available! It will load just fine on non-es2015 runtimes, too -- you just won't be able to use it.

I couldn't figure out how to do something like this that's good enough for __n, so I just... didn't. I'd happily write one up if there were an obvious way to do so, though.

@bcoe
Copy link
Copy Markdown
Member

bcoe commented May 15, 2017

@zkat this is cool 😄 we've already dropped 0.10 and 0.12 support in yargs; so we can just bump the major when we land this.

Comment thread test/y18n-test.js Outdated
try {
// We need to do this wrapper in case y18n gets used in runtimes
// without template literal support.
eval('__`Hello ${"Ben"} ${"Coe"}`').should.equal('Hello Ben Coe') // eslint-disable-line
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to test a translating to another language, so we confirm that the %s replacement works appropriately.

@zkat
Copy link
Copy Markdown
Contributor Author

zkat commented May 15, 2017

Change made! And I updated the .travis.yml so it matches up with what you currently have for yargs :)

@bcoe bcoe merged commit 0598daf into yargs:master May 17, 2017
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 this pull request may close these issues.

2 participants