GithubHelp home page GithubHelp logo

gettext-volt's Introduction

gettext-volt Build Status

Extract translatable strings from Volt 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 Volt expressions using the keywordspec. It returns an object with this structure:

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

gettext-volt's People

Contributors

dschissler avatar

Stargazers

Thành Thân Thiện avatar  avatar Mayel de Borniol avatar Denis Denisov avatar

Watchers

James Cloos avatar Serghei Iakovlev avatar  avatar  avatar

gettext-volt's Issues

Volt specific test fixtures

I had a bit more time to look at this and I noticed test/fixtures are exactly the same as gettext-swig's.
Looking at the regex differences, there seem to be other Volt formats?
If so, could you add examples of these to the test fixtures? And add tests for these accordingly?
Otherwise, it might be better to rename gettext-swig.

How to install this ?

Hi,
I've just installed xgettext-template

npm install -g xgettext-template

And I don't know what's the next step to use gettext-volt

npm install -g gettext-volt

...this command failed !

Please, help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.