{"action":"created","issue":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/616","labels_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/616/labels{/name}","comments_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/616/comments","events_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/616/events","html_url":"https://github.com/aldeed/meteor-autoform/issues/616","id":53979277,"number":616,"title":"Accessing field labels in your code","user":{"login":"SachaG","id":358832,"avatar_url":"https://avatars.githubusercontent.com/u/358832?v=3","gravatar_id":"","url":"https://api.github.com/users/SachaG","html_url":"https://github.com/SachaG","followers_url":"https://api.github.com/users/SachaG/followers","following_url":"https://api.github.com/users/SachaG/following{/other_user}","gists_url":"https://api.github.com/users/SachaG/gists{/gist_id}","starred_url":"https://api.github.com/users/SachaG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SachaG/subscriptions","organizations_url":"https://api.github.com/users/SachaG/orgs","repos_url":"https://api.github.com/users/SachaG/repos","events_url":"https://api.github.com/users/SachaG/events{/privacy}","received_events_url":"https://api.github.com/users/SachaG/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-11T02:29:45Z","updated_at":"2015-01-18T04:08:21Z","closed_at":null,"body":"I know you can use the `{{> afFieldLabelText}}` helper to access a field's label inside a template. But is there a way to do it from within your own code? As far as I can tell the label is not part of the context that's passed to the form templates. \r\n\r\nThis is related to https://github.com/aldeed/meteor-autoform/issues/483, I wanted to try using labels as an internationalization key to translate them in the template. "},"comment":{"url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/comments/70395789","html_url":"https://github.com/aldeed/meteor-autoform/issues/616#issuecomment-70395789","issue_url":"https://api.github.com/repos/aldeed/meteor-autoform/issues/616","id":70395789,"user":{"login":"aldeed","id":3012067,"avatar_url":"https://avatars.githubusercontent.com/u/3012067?v=3","gravatar_id":"","url":"https://api.github.com/users/aldeed","html_url":"https://github.com/aldeed","followers_url":"https://api.github.com/users/aldeed/followers","following_url":"https://api.github.com/users/aldeed/following{/other_user}","gists_url":"https://api.github.com/users/aldeed/gists{/gist_id}","starred_url":"https://api.github.com/users/aldeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldeed/subscriptions","organizations_url":"https://api.github.com/users/aldeed/orgs","repos_url":"https://api.github.com/users/aldeed/repos","events_url":"https://api.github.com/users/aldeed/events{/privacy}","received_events_url":"https://api.github.com/users/aldeed/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T04:08:21Z","updated_at":"2015-01-18T04:08:21Z","body":"It's not yet released, but in the next version of autoform I'm working on, there is `AutoForm.getFormSchema(formId)`, which can also be called without passing a formId when you're within a form's reactive context, and then will return the schema for the closest form.\r\n\r\nSo you could then do `AutoForm.getFormSchema().schema(fieldName).label`, and then check whether it's a function and if so, call it. That's the equivalent of what `mySchema.getDefinition` does, minus the label inflection. You'll also be missing the label reactivity, though.\r\n\r\nIf you want to add an option to `getDefinition` and `label` functions to skip the inflection, I would merge that PR. Relevant code is here: https://github.com/aldeed/meteor-simple-schema/blob/master/simple-schema.js#L820"}}