strongloop / strong-globalize

strong-globalize is built on Unicode CLDR and jquery/globalize and implements automatic extraction of strings from JS source code and HTML templates, lint the string resource, machine-translate them in seconds. In runtime, it loads locale and string resource into memory and provides a hook to persistent logging.
Other
25 stars 16 forks source link

Support template literals #112

Open bajtos opened 7 years ago

bajtos commented 7 years ago

Extend strong-globalize to support template literals via tagged template literals.

Sample usage:

const {_}  = require('strong-globalize')();

const name = 'world';
console.log(_`Hello ${name}`);

Preliminary list of tasks:

bajtos commented 7 years ago

An alternative to consider: modify g.f to support two invocations forms:

g.f('Hello %s', name);
g.f`Hello ${name}`;