This repository contains our internationalization files, synced every hour from Google Sheets, so they're version controlled i18n files with git. On built time, our website fetches them from here.
Every hour, a GitHub Actions workflow generates the files in the ./locales
directory from a Google Sheets spreadsheet with the following layout:
key | en-ch | de-ch |
---|---|---|
key1 | Value English | Value German |
In this spreadsheet, the cell A1
should be "key", and B1
...X1
should be language codes.
The generated file ./locales/de-ch.json
, for example, would be:
{
"key1": "Value German"
}
The following environment variables are required:
SHEET_ID
is the Google Sheet ID (see How to do I locate a Google Sheets ID?)BUILD_WEBHOOK
is the webhook to call after completing the process (optional)
You can also create a .i18nrc
file in the root of your project instead, with the keys sheetId
and buildWebhook
:
{
"sheetId": "example",
"buildWebhook": "https://example.com/post"
}
Run process locally:
npm run start
The code in this repository, with the exception of the locales
folder, are licensed under MIT.
The contents of the locales
folder are licensed under CC-BY-4.0.
An open source project by Koj.
Furnish your home in style, for as low as CHF175/month β