mongoose-i18n
Mongoose plugin for internationalization.
Install
npm install --save i18ngoose
Usage
const mongoose = ;const i18ngoose = ; // Create schema and define which attribute should be 'i18nable'let schema = title: type: String i18n: true ; // Load plugin to schema and define languagesschema; // Create mongoose model constrictorconst Model = mongoose; // Init new document from Model for given languagelet model = Model; // Set attributes for given languagemodel; // work with the model (save, ...)model; // get translated objectlet de = model;let en = model; // get translated json-objectlet de = model;let en = model;
Author
Christian Blaschke mail@platdesign.de