djhi / meteor-simpleschema-tapi18n-labels

Allows to useTapi18n for SimpleSchema labels
0 stars 0 forks source link

how to get i18n by js funtion like "i18n.get('file.obj.key')" on ostrio:i18n? #1

Closed thearabbit closed 9 years ago

thearabbit commented 9 years ago

how to get i18n by js funtion like "i18n.get('file.obj.key')" on ostrio:i18n?

dr-dimitru commented 9 years ago

@yuomtheara if you're using ostrio:i18n there is no need for other i18n packages. To use withSimpleSchema just return it from function, like:

Schema.AccountsProfile = new SimpleSchema({
  fullname: {
    type: String,
    label: function() {
      return i18n.get('accounts.fullname.label');
    },
    autoform: {
      placeholder: function() {
        return i18n.get('accounts.fullname.placeholder');
      }
    }
  },
  email: {
    type: String,
    regEx: SimpleSchema.RegEx.Email,
    label: function() {
      return i18n.get('accounts.email.label');
    },
    autoform: {
      type: 'email',
      placeholder: function() {
        return i18n.get('accounts.email.placeholder');
      }
    }
  }
});
djhi commented 9 years ago

This package uses tap:i18n. @dr-dimitru is right