{"id":15508862,"url":"https://github.com/cibernox/ember-i18n-errors","last_synced_at":"2025-09-04T19:09:46.062Z","repository":{"id":34984214,"uuid":"39066829","full_name":"cibernox/ember-i18n-errors","owner":"cibernox","description":"Extension to ember-i18n for translating error messages within the route hierarchy","archived":false,"fork":false,"pushed_at":"2021-08-25T05:40:51.000Z","size":19,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T12:46:45.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cibernox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-14T09:45:48.000Z","updated_at":"2020-10-21T11:44:16.000Z","dependencies_parsed_at":"2022-08-30T02:40:31.699Z","dependency_job_id":null,"html_url":"https://github.com/cibernox/ember-i18n-errors","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cibernox%2Fember-i18n-errors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cibernox%2Fember-i18n-errors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cibernox%2Fember-i18n-errors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cibernox%2Fember-i18n-errors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cibernox","download_url":"https://codeload.github.com/cibernox/ember-i18n-errors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357626,"owners_count":21417317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:40:30.115Z","updated_at":"2025-04-23T02:32:18.966Z","avatar_url":"https://github.com/cibernox.png","language":"JavaScript","readme":"# Ember-i18n-errors\n\nThis addon leverages [ember-i18n](https://github.com/jamesarosen/ember-i18n) but for the specific \npurpose of localize error messages. \n\nIt adds to your app a handy helper `{{t-error error}}` for translating errors in the context of\nthe current route, but also takes advantage of Ember's route nesting to lookup translations in fallback on \nparent routes.\n\n\n## Installation\n\nThis addon requires Ember.js 1.13+ and [ember-i18n](https://github.com/jamesarosen/ember-i18n) 4.1+\n\n* `ember install ember-i18n-errors`\n\n## Usage\n\nThis is better explained with an example.\n\nLet's say we have a validation error with the mandatory shape (`{ attribute: 'email', message: 'invalid' }`) and\nsome nested routes with this structure:\n\n```\nparent\n└── child\n    └── grandchild\n```\n\nIf within the `grandchild.hbs` template we use the helper `{{t-error error}}` the helper will try to\nfind the most especific translation key for it based on the route hierarchy. \n\nIt follows a set of conventions very similar to how [rails-i18n handles ActiveRecord errors](http://guides.rubyonrails.org/i18n.html#error-message-scopes).\n\nThe fallback chain for that error will be:\n\n```\nparent.child.grandchild.errors.email.invalid\nparent.child.grandchild.errors.invalid\nparent.child.errors.email.invalid\nparent.child.errors.invalid\nparent.errors.email.invalid\nparent.errors.invalid\nerrors.email.invalid\nerrors.invalid\n```\n\nIf none of those keys is defined in your translations the missing translation message will point you to the most\nspecific translation: `Missing translation: parent.child.grandchild.errors.email.invalid`.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcibernox%2Fember-i18n-errors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcibernox%2Fember-i18n-errors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcibernox%2Fember-i18n-errors/lists"}