0.1.0 • Published 5 years ago

parcel-transformer-localize v0.1.0

Weekly downloads
2
License
MPL-2.0
Repository
github
Last release
5 years ago

parcel-transformer-localize

Localize your static pages, quick and simple

Usage

Add parcel-transformer-localize as a transformer for parcel by adding this to your package.json

{
  "parcel": {
    "transforms": {
      "*.html": [
        "parcel-transformer-localize"
      ]
    }
  }
}

What it does

Basically it takes HTML snippets like these

<translate>
  <p>Hello <b>World</b></p>
</translate>

Converts them into translateable strings like those Hello %1World%2

And creates a translation file at the specified path

Creating translation files

Translation files are created automatically

In order to add a new language, simply add an empty file named LANGUAGE.json, it will be filled automatically