This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |