Open romanovma opened 7 years ago
Just implemented this a couple of days ago. I was able to use the pipe like this:
[messages]="{emptyMessage: 'NODATA' | translate, totalMessage: 'TOTAL' | translate, selectedMessage: false}"
That works on 7.1.1 and 9.1.0. It's a little different than other areas, but it works. This is using ngx-translate also.
@Poledouris This doesn't work with Angular's built-in i18n directive.
I'm submitting a ... (check one with "x")
Current behavior I want to translate the emptyMessage. Normally we use https://github.com/ngx-translate/core module to do translation so I put `{{ key | translate }} werever I want. I tried to find the way to pass this into emptyMessage property but it didn't work (I suppose because of https://github.com/swimlane/ngx-datatable/blob/a63a0ace4d6ab53b5b67144cd83f5471f1aa0584/src/components/body/body.component.ts#L55).
Expected behavior Is there any way to handle this? May be through
ngx-datatable-body-template
?Reproduction of the problem
What is the motivation / use case for changing the behavior? I actually can use https://github.com/ngx-translate/core#4-use-the-service-the-pipe-or-the-directive but it will be more consistent from my side to use pipes everywhere. Not a big deal anyway. Just asking.
Please tell us about your environment:
Table version: 6.1.1
Angular version: 4.0.0-rc.2
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: TypeScript 2.X