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
i18n on custom elements with @bindable does not work with 't.bind' #226
Comments
Hi @senal. I wasn't able to reproduce this issue on my side, could you create a small example as instructed with the issue template so that I can take a look at your exact setting? |
Hi @zewa666 , Thanks for your prompt reply. I thought it would be best to use the same component which is having the issue.
Alert-box custom elementWe implement a custom element to show alerts in our system. alert-box.html
` alert-box.ts [view-model] `import { bindable, bindingMode } from "aurelia-framework"; export class AlertBoxCustomElement {
}` Using alert-box in sample componentCASE 1: using 't' with expression dashboard.html `
dashboard.ts
} CASE 2: using 't.bind' with expression (The issue) dashboard.html
dashboard.ts
} Press the button you don't see any text printed on your view. Hope this helps you to get an insight into the problem context and eventually help us to resolve this issue. Let me know if you see anything wrong in the design or the implementation of this components. Feel free to contact me if you need further information. Thanks |
@senal thanks for the detailed description. I've tried that and ... it still works :) Now I'm really interested in seeing whats going wrong :) |
Hi @zewa666, Big thanks for your prompt feedback. :) Do you mind if I ask you to send (perhaps a link to a github repository) me your test project to test on my local ? Meantime I will do a sample project as you requested. Thanks for your interest in solving mysteries :) Regards |
Hi @zewa666 , The mystery has been solved. we changed the name of the property to Everything started to work ! P.S: Closing this issue. |
So it sounds like a side effect you had there. I'm glad it got resolved. |
I'm submitting a bug report
aurelia-i18n : 1.6.1
aurelia-framework: 1.1.2
Please tell us about your environment:
Operating System:
Windows [10]
Node Version:
6.9.5
Aurellia-CLI Version:
0.29.0
Browser:
all
Language:
TypeScript 2.2.2.0
Current Issue:
I have already post a question on SO.
https://stackoverflow.com/questions/44793186/i18n-on-custom-elements-with-bindable-does-not-work-with-t-bind
I'm creating an issue thinking this could be a bug.
I've noticed that a similar issue has been fixed in #123. But it was an issue with 't/i18n'
But I'm facing an issue with 't.bind'
We have a use case in which we need to construct the expression and bind it to 't/i18n'
e.g:
<template> <my-custom-element t.bind="messagekey" t-params.bind="{ param1: 10, param2: 10 }"></my-custom-element> <my-custom-element t.bind="messagekey"></my-custom-element> </template>
In the view-model we construct the messagekey as bellow:
this.messagekey = "[title]content_key";
When you run the application nothing is being written to the custom-element.
However, I tried this with 't' with literal values;
<template> <my-custom-element t="[title]content_key" t-params.bind="{ param1: 10, param2: 10 }"></my-custom-element> <my-custom-element t="[title]content_key"></my-custom-element> </template>
and it worked.
The text was updated successfully, but these errors were encountered: