Skip to content

Instantly share code, notes, and snippets.

View jamuhl's full-sized avatar

Jan Mühlemann jamuhl

View GitHub Profile
@jamuhl
jamuhl / server.js
Created January 13, 2016 07:35
i18next - multiple express apps
var i18next = require('i18next');
var middleware = require('i18next-express-middleware');
var Backend = require('i18next-node-fs-backend');
var express = require('express');
i18next
.use(Backend)
.init({
// use correct configuration options...look up docs!
backend: {
@jamuhl
jamuhl / react-intl-locize-supportLocize.js
Last active September 23, 2018 09:08
Used in medium post - unleash the hidden superpowers of react-intl
// a hoc to extend components with locize features
function supportLocize() {
return function Wrapper(WrappedComponent) {
class LocizeExtension extends Component {
constructor(props, context) {
super(props, context);
// get needed props
const { id, defaultMessage, description, namespace } = props;