alexsk / mongoose-intl

Mongoose schema plugin for multilingual fields
MIT License
74 stars 31 forks source link

feat: implement defaultLanguage & defaultLanguageAsFallback #18

Open aethys256 opened 5 years ago

aethys256 commented 5 years ago

This pull request aims to provide two new options to the plugin.

The first one let you choose a different defaultLanguage than the first language of the array (implemented mainly for the second one). The second one implements a language fallback, so if there is no content for the current language, the default language is used a fallback.

I'm using the fork for multiple months without issue though I would pull request back, there is no tests written so I did not add any. Let me know if something is wrong and I will fix it.