0

I can't find anything obvious that points to where the auto form labels come from in Telescope. The are no labels in the schemas that I can see (at least not for Posts), there is nothing obvious in at least in the Posts autoform call...

{{> quickForm collection="Posts" id="submitPostForm" template="bootstrap3-horizontal" input-col-class="controls" type="method" meteormethod="submitPost" fields=postFields}}

... I can't locate any fieldsets or other obvious ways to pass labels to auto forms. So, as an example, 'createdAt' from the Posts schema ends up having a display label of 'Created At' when displayed in the forms - where and how does that 'conversion' happen?

TIA!

D Durham
  • 1,243
  • 2
  • 20
  • 42

2 Answers2

0

Nevermind... I found the answer after digging a bit more... there is an internationalize method extending SimpleSchema and called before attaching the schema that handles this:

SimpleSchema.prototype.internationalize = function () {
  var schema = this._schema;

  _.each(schema, function (property, key) {
    if (!property.label) {
      schema[key].label = function () {
        // if property is nested ("telescope.email"), only consider the last part ("email")
        if (key.indexOf(".") !== -1) {
          key = _.last(key.split("."));
        }
        return i18n.t(key);
      };
    }
  });
  return this;
};
D Durham
  • 1,243
  • 2
  • 20
  • 42
0

Form labels are internationalized using the tap:i18n package. So you can find their translations in the respective *.i18n.json file for your current language, in each package's /i18n directory.

Sacha
  • 1,987
  • 1
  • 24
  • 41