Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
📝 Add project docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Aug 7, 2020
1 parent 8d1d71d commit 9b20287
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions README.md
@@ -0,0 +1,54 @@
# 🌐 Koj I18N

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.

[![Update CI](https://github.com/koj-co/i18n/workflows/Update%20CI/badge.svg)](https://github.com/koj-co/i18n/actions?query=workflow%3A%22Update+CI%22)
[![Trigger CI](https://github.com/koj-co/i18n/workflows/Trigger%20CI/badge.svg)](https://github.com/koj-co/i18n/actions?query=workflow%3A%22Trigger+CI%22)

## ⭐ How it works

Every hour, a GitHub Actions workflow generates the files in the [`./locales`](./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 `A2`...`A` should be language codes.

The generated file [`./locales/de-ch.json`](./locales/de-ch.json), for example, would be:

```json
{
"key1": "Value German"
}
```

### Configuration

The following environment variables are required:

- `SHEET_ID` is the Google Sheet ID (see [How to do I locate a Google Sheets ID?](https://stackoverflow.com/a/36062068/1656944))
- `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`:

```json
{
"sheetId": "example",
"buildWebhook": "https://example.com/post"
}
```

## 👩‍💻 Development

Run process locally:

```bash
npm run start
```

## 📄 License

The code in this repository, with the exception of the `locales` folder, are licensed under [MIT](./LICENSE.MIT).

The contents of the `locales` folder are licensed under [CC-BY-4.0](./LICENSE.CC).

0 comments on commit 9b20287

Please sign in to comment.