feat(SW-706): add diff tooling
This commit is contained in:
@@ -306,9 +306,18 @@ Extracts the messages from calls to `intl.formatMessage()` and other supported m
|
||||
Running the following command will generate a JSON file at `./i18n/tooling/extracted.json`. The format of this file is for consumption by Lokalise. This JSON file is what gets uploaded to Lokalise.
|
||||
|
||||
```bash
|
||||
npm run i18n:extract
|
||||
yarn workspace @scandic-hotels/scandic-web i18n:extract
|
||||
```
|
||||
|
||||
#### Checking for changes between codebase and Lokalise
|
||||
|
||||
> _NOTE_: Diff only considers the English language.
|
||||
|
||||
It is recommended to download the latest labels from Lokalise to make sure you have the latest before diffing. See below.
|
||||
|
||||
- Run the message extraction above.
|
||||
- Run `yarn workspace @scandic-hotels/scandic-web i18n:diff`
|
||||
|
||||
#### Message upload to Lokalise
|
||||
|
||||
Set the environment variable `LOKALISE_API_KEY` to the API key for Lokalise.
|
||||
@@ -318,7 +327,7 @@ Running the following command will upload the JSON file, that was generated by e
|
||||
It supports the different upload phases from Lokalise meaning that once this command completes the messages are available for translation in Lokalise.
|
||||
|
||||
```bash
|
||||
npm run i18n:upload
|
||||
yarn workspace @scandic-hotels/scandic-web i18n:upload
|
||||
```
|
||||
|
||||
#### Message download from Lokalise
|
||||
@@ -330,7 +339,7 @@ Running the following command will download the translated assets from Lokalise
|
||||
_DOCUMENTATION PENDING FOR FULL WORKFLOW._
|
||||
|
||||
```bash
|
||||
npm run i18n:download
|
||||
yarn workspace @scandic-hotels/scandic-web i18n:download
|
||||
```
|
||||
|
||||
#### Message compilation
|
||||
@@ -340,9 +349,15 @@ Compiles the assets that were downloaded from Lokalise into the dictionaries use
|
||||
_DOCUMENTATION PENDING FOR FULL WORKFLOW._
|
||||
|
||||
```bash
|
||||
npm run i18n:compile
|
||||
yarn workspace @scandic-hotels/scandic-web i18n:compile
|
||||
```
|
||||
|
||||
#### Convenience script targets
|
||||
|
||||
Extract and upload: `yarn workspace @scandic-hotels/scandic-web i18n:push`
|
||||
Download and compile: `yarn workspace @scandic-hotels/scandic-web i18n:pull`
|
||||
Extract, upload, download and compile (push && pull): `yarn workspace @scandic-hotels/scandic-web i18n:sync`
|
||||
|
||||
### The workflow
|
||||
|
||||
We use the following technical stack to handle translations of UI labels.
|
||||
|
||||
Reference in New Issue
Block a user