Localize your static pages, quick and simple
Add parcel-transformer-localize as a transformer for parcel by adding this to your package.json
{
"parcel": {
"transforms": {
"*.html": [
"parcel-transformer-localize"
]
}
}
}
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
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