# leajs-locale

> simplifies handling locale header

Latest version **0.1.0** (published 2018-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install leajs-locale
pnpm add leajs-locale
yarn add leajs-locale
bun add leajs-locale
```

## 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.1.0 |
| Published | 2018-05-29 |
| First published | 2018-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Paul Pflugradt |
| Maintainers | paulpflug |

## Links

- npm: https://www.npmjs.com/package/leajs-locale
- Repository: https://github.com/lea-js/leajs-locale
- Homepage: https://github.com/lea-js/
- Issues: https://github.com/lea-js/leajs-locale/issues
- npm.io page: https://npm.io/package/leajs-locale

## Recent versions

- 0.1.0 (latest) — 2018-05-29

## README

# leajs-locale

Plugin of [leajs](https://github.com/lea-js/leajs-server).

Simplifies handling locale header.

## leajs.config

```js
module.exports = {

  // …

  // Locale options, can be used as a shortcut for 'locale.available'
  locale: null, // [Object, Array]

  // Available languages, first languages is fallback
  locale.available: null, // Array

  // Query property to overwrite browser language
  locale.query: null, // String

  // Position in url to look for used language
  locale.url: null, // Number

  // …

}
```

## Example

```js
module.exports = {

  // …

  locale: {
    available: ["en","de"],
    query: "lang", // will allow ?lang=en
    url: "1" // will parse /de/someurl
  }
  
  // …

}
```

## License
Copyright (c) 2018 Paul Pflugradt
Licensed under the MIT license.

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