Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Breadcrumb title i18n issue #69

Closed
Amerr opened this issue Mar 3, 2016 · 5 comments
Closed

Breadcrumb title i18n issue #69

Amerr opened this issue Mar 3, 2016 · 5 comments

Comments

@Amerr
Copy link

Amerr commented Mar 3, 2016

import { translationMacro as t } from "ember-i18n";

breadCrumb: {
title: t('settings.language'),
}

Error: Uncaught Error: Assertion Failed: Cannot translate settings.language. [object Object] does not have an i18n.

@abhilashlr
Copy link
Contributor

If I understand ember-i18n, translationMacro from ember-i18n is a translation Computed property. You might have to use it as

breadCrumb: {
   title: this.i18n.t('settings.language')
}

@abhilashlr
Copy link
Contributor

@poteto we can close this issue as it isn't related to crumbly

@fsmanuel
Copy link
Collaborator

@abhilashlr I think we can come up with a good solution to this problem. Setting the title in the route is not nice cause you have to set it in all you controllers. I guess a i18nKey is a good idea. I'll put some thought into this cause I'm facing the same issue.

@mrkirchner
Copy link

mrkirchner commented Dec 6, 2016

Anything come from this thread?

breadCrumb: { title: this.i18n.t('settings.language') }

This doesn't work because .t is undefined. Seems that the service is injected after i forked the project added i18n to addon and implemented a new property localizationTitle but probably not the best solution.

@fsmanuel
Copy link
Collaborator

fsmanuel commented Dec 6, 2016

@mrkirchner use a computed property:

breadCrumb: computed(function() {
  let i18n = get(this, 'i18n');
  return { title: i18n.t('settings.language') };
})

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

No branches or pull requests

5 participants