Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap-i18n-db and aldeed collection2 #21

Open
arminschleicher opened this issue Sep 23, 2015 · 2 comments
Open

tap-i18n-db and aldeed collection2 #21

arminschleicher opened this issue Sep 23, 2015 · 2 comments

Comments

@arminschleicher
Copy link

Hey Guys, has anyone ever tried using tap-i18n-db package with collections using the collection2 package? i tried a lot of stuff but couldn't get it working...would love to see some of your sample code! thanks and cheers!

@arminschleicher arminschleicher changed the title tap-i18n-db and aldeed autoform tap-i18n-db and aldeed collection2 Sep 24, 2015
@mikeifomin
Copy link

@arminschleicher, what kind of problems do you have?

For me it works great together. A little trick I noticed: add field i18n to SimpleSchema

Posts = new TAPi18n.Collection('posts')

Posts.attachSchema(new SimpleSchema({

  title: {
     type: String,
  }

  // all translations is inside this field
  i18n: {
    type: Object,
    // important for skip validation
    blackbox: true,
    optional: true
  }

}

But it code has some danger side effects!
Any "hacker" :) can save to i18n filed any structure and overwrite document, so before updateTranslations function we need to validate data manually.

Can some one tell better solution?

@samuelluis
Copy link

I have a similar code, but doesn't work, the insertTranslations function returns null and doesn't insert anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants