You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

i18n-stack

Package Overview
Dependencies
Maintainers
1
Versions
3
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.1
latest
Source
npmnpm
Version published
Weekly downloads
1
-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version 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

i18n

FAQs

Package last updated on 06 Jun 2025

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