mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Merge pull request #1115 from saimeunt/master
Fix schema i18n by moving internationalize to collections
This commit is contained in:
commit
93232aa639
2 changed files with 6 additions and 4 deletions
|
@ -40,9 +40,8 @@ i18n.t = function (str, options) {
|
|||
}
|
||||
};
|
||||
|
||||
SimpleSchema.prototype.internationalize = function () {
|
||||
var schema = this._schema;
|
||||
|
||||
Mongo.Collection.prototype.internationalize = function(){
|
||||
var schema = this.simpleSchema()._schema;
|
||||
_.each(schema, function (property, key) {
|
||||
if (!property.label) {
|
||||
schema[key].label = function () {
|
||||
|
|
|
@ -226,7 +226,10 @@ Posts.schema = new SimpleSchema({
|
|||
});
|
||||
|
||||
// schema transforms
|
||||
Posts.schema.internationalize();
|
||||
Meteor.startup(function(){
|
||||
// needs to happen after every fields were added
|
||||
Posts.internationalize();
|
||||
});
|
||||
|
||||
/**
|
||||
* Attach schema to Posts collection
|
||||
|
|
Loading…
Add table
Reference in a new issue