Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18n-stack

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-stack

Stack of connect middleware for language/locale detection and translation.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM version Dependency Status Dev Dependency Status

i18n-stack

Stack of connect middleware for language/locale detection and translation.

  • detectLanguage - parse and detect browser language preference
  • overwriteLanguage - overwrite language selection with query param and/or cookie
  • gettext - insert simple gettext implementation in response

Also exposes parseAcceptLanguage - in case if you need parsed form of Accept-Language header for some other reason than language selection.

If you don't need this exact stack all of its components can be used separately.

Install

$ npm install --save i18n-stack

Usage


var app = require('express');

var locale = {
  supportedLanguages: ['de', 'fr', 'pl', 'en-GB', 'en-US'],
  defaultLanguage: 'en',
  gettextAlias: '_'
};

var i18n = require('i18n-stack');

app.use(i18n.overwriteLanguage(locale));
app.use(i18n.detectLanguage(locale));
app.use(i18n.gettext(locale));


License

MIT © Damian Krzeminski

Keywords

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc