DEV Community

Discussion on: Help: How to make a multilanguage website?

Collapse
avalander profile image
Avalander

You could use a template engine like moustache to process your html pages before uploading them, then you can have only one version of each page and render it multiple times with the different languages and upload that to your server.

# my-page.html
<h1>{{ myPage.title }}</h1>
Enter fullscreen mode Exit fullscreen mode
// en.json
{
  "myPage.title": "Welcome"
}

// es.json
{
  "myPage.title": "Bienvenido"
}
Enter fullscreen mode Exit fullscreen mode
mustache en.json my-page.html > en/my-page.html
mustache es.json my-page.html > es/my-page.html
Enter fullscreen mode Exit fullscreen mode