ncuillery / angular-breadcrumb

Generate a breadcrumb from ui-router's states
http://ncuillery.github.io/angular-breadcrumb/
MIT License
785 stars 183 forks source link

Translating angular breadcrumb last #125

Closed 1nfinite closed 8 years ago

1nfinite commented 8 years ago

I understand that the ncy-breadcrumb can be translated using angular translate with custom template. However, I could not find a way to translate ncy-breadcrumb-last from the documentation.

<span ncy-breadcrumb-last></span>

freethejazz commented 8 years ago

@1nfinite: I'm working on a fix for #123, which will allow you to use a custom template for ncy-breadcrumb-last. You'll see in the comments there that I'm in a bit of a yak shave, but hope to surface soon and address the original issue.

freethejazz commented 8 years ago

@1nfinite I've got a PR open for creating a template for this, but I discovered an undocumented way of doing this when writing tests for the new functionality. You simply set a value to the ncyBreadcrumbLast directive and that value gets used for the template:

<span ncy-breadcrumb-last="{{ncyBreadcrumbLabel | translate}}"></span>

The problem with this approach is that you'll have to set the value for every ncyBreadcrumbLast directive you use, but if upgrading to the next release isn't an option, it'll do.