0.3.0 • Published 8 years ago

mongoose-i18n v0.3.0

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

Mongoose i18n Schema Plugin

Surprisingly there is not a proper plugin for this. I found a couple gists that do this:

I didn’t see anything in the npm repo, so...

Usage

Install:

npm i --save mongoose mongoose-i18n

Create your schema:

mongoose = require 'mongoose'
i18nPlugin = require 'mongoose-i18n'

# ... create your schema, e.g. MySchema ... #

MySchema.plugin i18nPlugin, languages: ['en', 'fr'], defaultLanguage: 'en'