translations-server
v1.4.0
Published
Translations server
Readme
Translations server
This server reads and writes translations files fetched on / from S3. It keeps a cached version of the translation files on Redis for a given time and then refetches them from S3 when cache expires.
Usage
Just call a GET request in the following format:
/:projectId/:lang/:filename where:
projectIdis the project ID in OneSkyApplangis the language you want to loadfilenameis the filename you want to load
Install
npm i
npm run build
npm startDev
npm i
npm run watchEnvironnement variables
You must set some environnement variable to get your server working.
CACHE_DELAY: Duration in millisecond of translation files cache retention
Test with Localstack (AWS local emulator)
- Run Localstack in a docker container (already included in bk-docker-stack-dev repo)
- You can then access a localstack admin page locally at https://app.localstack.cloud/inst/default/status
- From this repo's root, launch
sh localstack/initLocalstack.shto create a S3 bucket and copy demo translation files in it.
