Skip to content
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

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

Merged
merged 2 commits into from
May 17, 2017
Merged

Conversation

zkat
Copy link
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
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.

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
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
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