# eslint-plugin-i18n-text

> Disallow English text in string literals

Latest version **1.0.1** (published 2019-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-i18n-text
pnpm add eslint-plugin-i18n-text
yarn add eslint-plugin-i18n-text
bun add eslint-plugin-i18n-text
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-09-16 |
| First published | 2018-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | David Graham |
| Maintainers | dgraham, josh, mislav, muan |
| Keywords | eslint, eslintplugin, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-i18n-text
- Repository: https://github.com/dgraham/eslint-plugin-i18n-text
- Homepage: https://github.com/dgraham/eslint-plugin-i18n-text#readme
- Issues: https://github.com/dgraham/eslint-plugin-i18n-text/issues
- npm.io page: https://npm.io/package/eslint-plugin-i18n-text

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-09-16
- 1.0.0 — 2019-02-07
- 0.2.0 — 2018-01-08
- 0.1.1 — 2018-01-06

## README

# eslint-plugin-i18n-text

Disallow English text in string literals.

Embedding messages in JavaScript files prevents them from being translated into
other languages. An alternative is to embed the translated text in the markup
and find it with JavaScript.

```html
<div class="js-message" data-success-message="It works!">…</div>
```

```js
const el = document.querySelector('.js-message')
el.textContent = el.getAttribute('data-success-message')
```

This pattern allows the web framework that's generating the markup to use
its translation library to insert the appropriate translated text.

## Installation

You'll first need to install [ESLint](http://eslint.org):

```
$ npm install eslint --save-dev
```

Next, install `eslint-plugin-i18n-text`:

```
$ npm install eslint-plugin-i18n-text --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-i18n-text` globally.

## Usage

Add `i18n-text` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
  "plugins": [
    "i18n-text"
  ],
  "rules": {
    "i18n-text/no-en": 2
  }
}
```

## Development

```
npm install
npm test
```

## License

Distributed under the MIT license. See LICENSE for details.

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