Multilingual or i18n support #19
-
Hi. First or all, nice work. I don't see a way to support a multilingual site using this package. I mean, I could probably set an alias for every route and then set that on every page to the translated value, but it doesn't seem very elegant. Is there a better way to approach this? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
Hey @john-- Thank you. I would like to add i18n support. There are couple of solutions like Angular default i18n, @ngx-translate , @ngneat/transloco. Which one are you using? I will try to add this ability in better way. |
Beta Was this translation helpful? Give feedback.
-
Hi, yes exactly :) |
Beta Was this translation helpful? Give feedback.
-
Thats a good idea 💡 . If i could let the user wrap the breadcrumb label with a custom pipe of choice (translate, transloco or even initCap) it could be useful. Let me see how it works. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a plan! Thanks! |
Beta Was this translation helpful? Give feedback.
-
@john-- Good news. I have added this ability. With latest xng-breadcrumb release, you can provide custom template for breadcrumb, where you can pipe or do whatever you want :) With ngx-translate you can use like - <xng-breadcrumb>
<ng-container *xngBreadcrumbItem="let breadcrumb">
<ng-container>{{ breadcrumb | translate }}</ng-container>
</ng-container>
</xng-breadcrumb> Do check the README and update the library version. |
Beta Was this translation helpful? Give feedback.
-
You are a wonderful person. Thanks so much! |
Beta Was this translation helpful? Give feedback.
-
Thank you! 😊 I will close the issue, since it's resolved |
Beta Was this translation helpful? Give feedback.
@john-- Good news. I have added this ability.
With latest xng-breadcrumb release, you can provide custom template for breadcrumb, where you can pipe or do whatever you want :)
With ngx-translate you can use like -
Do check the README and update the library version.
xng-breadcrumb@4.0.0(Angular 6, 7) or xng-breadcrumb@5.0.0 (Angular 8+)