-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breadcrumb label translations support #65
Comments
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> |
ncuillery. Very good |
I like this version of breadcrumbs template with support of translations (written in Jade):
|
@jamhall I'm not very kind of this option. I prefer keep the API simple and let users making a custom template. I think I'll make a FAQ wiki page. I keep the issue open to remember to add an entry for angular-translate integration. |
I'm happy with the solution offered above :-). Thanks |
So don't close it please ;-) |
@ncuillery I tried custom template like you suggested, but it only works after I move to another state. On initial load my breadcrumbs are not translated. Any suggestions how to fix it? |
Hi there, I was in the very same case as you did @goliney, I found this on Stack Overflow and it worked like a charm: Basically (quoted from Stack Overflow): Anything that goes on the scope shouldn't use gettextCatalog.getString. Use something like this: $rootScope.stepText = gettext("My step 1 title"); {{stepText | translate}} |
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:
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? |
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:
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.
The text was updated successfully, but these errors were encountered: