# git18n

> Lightweight utility that automates translations management using `react-intl` (FormatJS).

Latest version **2.0.3** (published 2022-07-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install git18n
pnpm add git18n
yarn add git18n
bun add git18n
```

Provides the command `git18n`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2022-07-20 |
| First published | 2022-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 16.5.0 |
| Dependencies | 4 |
| Unpacked size | 267.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lasse T. |
| Maintainers | lassekt |

## Links

- npm: https://www.npmjs.com/package/git18n
- Homepage: https://github.com/lassegit/git18n-node
- npm.io page: https://npm.io/package/git18n

## Dependencies (4)

- [minimist](https://npm.io/package/minimist.md) ^1.2.6
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.11
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.7
- [@formatjs/cli-lib](https://npm.io/package/@formatjs/cli-lib.md) 5.0.5

## Recent versions

- 2.0.3 (latest) — 2022-07-20
- 2.0.2 — 2022-07-18
- 2.0.1 — 2022-07-14
- 2.0.0 — 2022-07-14
- 1.0.6 — 2022-07-07
- 1.0.5 — 2022-06-27
- 1.0.4 — 2022-06-06
- 1.0.3 — 2022-05-11
- 1.0.2 — 2022-05-11
- 1.0.1 — 2022-05-11
- 1.0.0 — 2022-05-11

## README

Lightweight utility that automates translations management using `react-intl` (FormatJS).

## Installation

```
yarn add -D git18n
```

Or with npm:

```
npm install --save-dev git18n
```

(Node version 16.5 or higher).

## How to use:

1. Retrieve access token on [git18n.com](https://git18n.com) and set as environment variable (`GIT18N_SECRET_PROJECT_KEY="your-app-key"`)

2. Add `translate` command to `package.json`:

```json
"scripts": {
  "translate": "git18n --files 'src/**/*.js*'"
}
```

Default values for `--files` and `--ignore` are:

```
const DEFAULT_FILES_ARG = '(components|containers|pages|src|modules)/**/*.{ts,tsx,js,jsx}';
const DEFAULT_IGNORE_ARG = '**/*.d.ts';
```

Additional arguments:

- `--clean` removes translation IDs not present in code
- `--prettyLocale` formats locale files with line-breaks

3. Run `yarn translate` to add new translations (i.e. when submitting a pull request) and when deploying (as part of the build process, e.g. `yarn translate && yarn build`).

There is no need to `yarn translate` during development since it just uses the `defaultMessage` as fallback.

**Note: Full docs: https://docs.git18n.com**

_Please submit questions or bugs to: https://github.com/lassegit/git18n-node_

---
_Source: https://npm.io/package/git18n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
