Socket
Socket
Sign inDemoInstall

gettext-handlebars

Package Overview
Dependencies
7
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gettext-handlebars

Extract translatable strings from Handlebars templates


Version published
Maintainers
1
Install size
1.29 MB
Created

Readme

Source

gettext-handlebars build status

Extract translatable strings from Handlebars template strings.

It can be used stand-alone or through gmarty/gettext.

API

new Parser(keywordspec)

Creates a new parser. The keywordspec parameter is optional, with the default being:

{
  _: [0],
  gettext: [0],
  ngettext: [0, 1]
}

Each keyword (key) requires array of argument number(s) (value). When multiple argument numbers are specified, expressions using this keyword are treaded as single-plural.

.parse(template)

Parses the template string for Handlebars expressions using the keywordspec. It returns an object with this structure:

{
  msgid1: {
    line: [1, 3]
  },
  msgid2: {
    line: [2],
    plural: 'msgid_plural'
  }
}

Keywords

FAQs

Last updated on 25 Aug 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc