I want to save/serve multilingual data in my CMS application using Mongoose.
Is this the correct way?
name: {
global: {
type: String,
default: '',
trim: true,
required: 'Please fill name',
},
en_US: String,
tr_TR: String,
sv_SE: String
}
Best Answer
I do not this that you have any "correct" or "bad" way, it is mostly based on your application design and requirements.
However, you may have noticed that in MongoDB 2.6.x the Full Text Search feature supports multi languages indexing and search if you specify a language in a document. This allow you to search text by language.
Documents look like:
for more informations:
http://docs.mongodb.org/manual/reference/text-search-languages/#text-search-languages