Skip to content

Support template literals #112

@bajtos

Description

@bajtos

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:

  • When gathering strings to potentially localize, look for template literals and convert them into messages with indexed placeholders. In the example above, the following messages entry should be created: Hello {0}
  • Implement _ as a tag function applying localization under the hood.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions