Skip to content

Instantly share code, notes, and snippets.

View mashpie's full-sized avatar

Marcus Spiegel mashpie

View GitHub Profile
@mashpie
mashpie / i18n-express-cookie-app.js
Last active June 19, 2023 07:47
express + i18n-node + cookieParser and avoid concurrency issues
@mashpie
mashpie / i18n-node-http.js
Last active May 3, 2021 17:50
basic plain vanilla setup in node with http
// require modules
var http = require('http'),
i18n = require('i18n'),
app;
// minimal config
i18n.configure({
locales: ['en', 'de'],
directory: __dirname + '/locales'
});
@mashpie
mashpie / i18n-express-hbs-app.js
Last active May 1, 2024 19:55
express + i18n-node + handlebars and avoid concurrency issues
// require modules
var express = require('express'),
i18n = require('i18n'),
hbs = require('hbs'),
app = module.exports = express();
i18n.configure({
locales: ['en', 'fr'],
cookie: 'locale',
directory: "" + __dirname + "/locales"
@mashpie
mashpie / i18n-express-mustache-app.js
Last active September 26, 2018 16:31
express + i18n-node + mustache (via consolidate.js) and avoid concurrency issues
// require modules
var express = require('express'),
i18n = require('../../i18n'),
url = require('url'),
cons = require('consolidate'),
app = module.exports = express();
// minimal config
i18n.configure({
locales: ['en', 'de'],
@mashpie
mashpie / i18n-restify-app.js
Created June 2, 2013 17:39
i18n-node in an restify app setup
// require modules
var restify = require('restify'),
i18n = require('i18n'),
app;
// minimal config
i18n.configure({
locales: ['en', 'de'],
directory: __dirname + '/locales'
});
@mashpie
mashpie / i18n-express4-cookie-example.js
Last active August 12, 2021 15:48
i18n-express4-cookie-example