decanat-get-locale

0.0.1 • Public • Published

get-locale Build Status

Detect language preference of a page or an element.

Installation

Install with component:

$ component install decanat/get-locale

Install with npm for browserify:

$ npm install decanat-get-locale

Usage

To get preferred language getLocale checks following sources (in order):

  • HTML lang attribute
  • Cookies
  • navigator.language
  • Default, specified in config
var getLocale = require('get-locale');

getLocale(); // 'en-US'

Testing

To test with PhantomJS, run:

$ make test    

License

The MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i decanat-get-locale

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • antaranian