# localise-text

> An easier way to localise your Node.JS programs for users.

Latest version **0.0.2** (published 2019-08-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install localise-text
pnpm add localise-text
yarn add localise-text
bun add localise-text
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-08-04 |
| First published | 2019-08-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oliver Cordingley |
| Maintainers | olivercordingl1 |
| Keywords | localisation, localization, locale, locales, translation, language |

## Links

- npm: https://www.npmjs.com/package/localise-text
- Repository: https://github.com/CordEmpire/Localise
- Issues: https://github.com/CordEmpire/Localise/issues
- npm.io page: https://npm.io/package/localise-text

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2019-08-04
- 0.0.1 — 2019-08-04

## README

# localise-text
---
### Install
To install using NPM: `npm i -S localise-text`
### How to use:
1) Create a folder in the same directory as the file using the package.
2) To initialise the `localise-text` package,
```JavaScript
const Localiser = require('localise-text');
let l = new Localiser(<location of the languages folder>);
l.init({<Settings (See bottom of file)>});
```
3) To get the text from the language ID,
```JavaScript
l.translate("<lang_id>");
```
4) To change the language id,
```JavaScript
l.setNewLanguage("<new language id>");
```
### Format of Language file
The format of the language file is simply just a JSON Object, and is probably the simplest thing you'll ever see.

To make a language file, first name it the locale alias, such as `en_US` or `nl`, and give it the `.json` extension.

To assign text to values, do the following:
```JSON
{
	"localisation_id": "Text to display!",
	"buttons.home_button": "Home",
	"buttons.send_email": "Send Email!"
}
```
### Settings 
* `language` : The language ID
* `leaveIDIfNotExist` : Whether or not to show the language ID if the matching text could not be found.
### Dependencies
I would like to take this space to thank all of the dependencies that allowed this project to come to life- wait, oh yeah! I didn't include any, you're welcome for keeping your `package-lock.json` clean 😉

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