1.0.0 • Published 9 years ago

jquery.language v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

jquery.language Build Status Code Climate

This plugin helps managing browser languages. It looks for a url param or the navigator language and stores the language in a cookie.

Usage

javascript

$.language({
  active: 'auto',
  fallback: 'de',
  available: ['en', 'de']
});

console.log($.language()); //prints de or en

$.language('de') //sets the language

coffee script

$.language
  active: 'auto'
  fallback: 'de'
  available: [
    'en'
    'de'
  ]

console.log $.language() #prints de or en

$.language 'de' #sets the language

Dependencies

Parameter

active

auto - default, means try to detect from url param, cookie, navigator or use fallback
or a available language

fallback

language that is used if no language could be detected

available

array of allowed languages, default is ['en']

urlParam

name of the url param to watch for, default is 'language'

cookieName

name of the cookie for language storing, default is 'language'

Contributing

Check out the Contributing Guidelines

Authors

Tom Hanoldt