bedrock-i18n

2.0.4 • Public • Published

bedrock-i18n

A bedrock module that adds minimal internationalization support to bedrock-express.

bedrock-i18n is built using i18n. When bedrock starts, (the bedrock.start event), it will scan all paths in bedrock.config.express.static looking for root directories that are named after ISO 639-1 codes. Each matching directory is cached to be used later for language-specific HTTP requests. Specifically, when an HTTP request is made with an Accept-Language header, if the matching language is in the cache and the requested URL matches a path in that directory, the language-specific file is returned in the response.

Requirements

  • npm v3+

Quick Examples

npm install bedrock-i18n
var bedrock = require('bedrock');
 
require('bedrock-server');
require('bedrock-express');
require('bedrock-i18n');
 
bedrock.start();

Configuration

For more documentation on configuration see config.js.

Readme

Keywords

Package Sidebar

Install

npm i bedrock-i18n

Weekly Downloads

1

Version

2.0.4

License

none

Unpacked Size

10.4 kB

Total Files

13

Last publish

Collaborators

  • davidlehn
  • dlongley
  • mattcollier
  • msporny