question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breadcrumb label translations support

See original GitHub issue

Hi!

First of all, great module!

It would be nice if this module supported translations for the breadcrumbs labels.

It could be passed in as an extra option to enable it:

myAppModule.config(function($breadcrumbProvider) {
    $breadcrumbProvider.setOptions({
      translations: true
    });
  })

What are your thoughts?

I would happily implement it if you’d like… Of course I’d make sure that the dependency for the angular-translate module is optional.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ncuillerycommented, Dec 19, 2014

I suppose you have in mind to translate the labels containing translate keys programmatically if the options is set to true, right ?

How about using a custom template like this ?

<ol class="breadcrumb">
  <li ng-repeat="step in steps" ng-class="{active: $last}" ng-switch="$last || !!step.abstract">
    <a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel | translate}}</a>
    <span ng-switch-when="true">{{step.ncyBreadcrumbLabel | translate}}</span>
  </li>
</ol>
0reactions
arielcrcommented, Jun 27, 2016

Hi there,

Nice solution! I was wondering what about variable replacement in translate filter. I’ve already tried passing some random text, and it works pretty fine, but I need is to specify a variable, not some static text, for example:

<a ng-switch-when="false" href="{{step.ncyBreadcrumbLink}}">{{step.ncyBreadcrumbLabel | translate:"{entity:variable}"}}</a>

I tried accessing a scope variable, but then I realized that I cannot access the rootScope or scope data inside .config. Maybe some provider that I can access in .config?

Has anybody run through this also?

Read more comments on GitHub >

github_iconTop Results From Across the Web

translation in breadcrumb angular 5 - Stack Overflow
You can use ngx-translate/core. Just import it, define en.json file and in your breadcrumb component you can do it by injecting
Read more >
[Closed] Breadcrumb label not translate but link is ok - WPML
hi i'm using Yoast! Breadcrumb. Everything works except for a customPost called "Fromage" : the slug is correctly translated as.
Read more >
Translate Breadcrumbs - SEOPress
Add texts to translate To do that, go to SEO, PRO, Breadcrumbs tab. Check the blue radio button associated with Breadcrumbs.
Read more >
Translating "Home" in breadcrumbs - Support - Themeco Forum
In this article, we're going to explain how to translate our themes into any language. The label you should search for in POEDIT...
Read more >
Translate Breadcrumbs in portal - ServiceNow Community
Hello All, Can you please help me with the below query? The requirement is to translate the texts in portal for spanish users....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found