Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vtex/intl-equalizer

👯‍♂️
https://github.com/vtex/intl-equalizer

srv-store-framework xp-developer

Last synced: about 1 month ago
JSON representation

👯‍♂️

Awesome Lists containing this project

README

        

# 👯‍♂️ Intl-Equalizer

A VTEX CLI for linting locale string files

Easy tool to compare between locale files and find missing keys

# Installation

Install Intl-Equalizer using yarn:

`yarn add --dev @vtex/intl-equalizer`

Or via npm:

`npm install --save-dev @vtex/intl-equalizer`

# Configuration

**1)** Add a new script to your package.json:

```json
"scripts": {
"lint:locales": "intl-equalizer"
}
```

**2)** And Intl-Equalizer config in your `package.json` if you need to change the default values:

```
// package.json
{
"intl-equalizer": {
"referenceLocale": "pt",
"localeDirectory": "src/locales/",
"filesToIgnore": ["context.json"]
}
}
```

> `referenceLocale` default value is `'en'`

> `localeDirectory` default value is `'/messages'`

> `filesToIgnore` default value is an empty array`

# Optional Commands

## Fix

Command to fix the order of the locale keys based on the `referenceLocale`

```
intl-equalizer --fix
```

## All

Using `intl-equalizer --all`, or its shorthand `intl-equalizer -a`, will override the fail-fast behavior and instead list all errors.