-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
aurelia-i18n breaks standard content projection done by aurelia #200
Comments
@mar9000 sorry for letting you wait so long. I did some research and I think we can handle those scenarios.
are those somewhat what you'd expect? Any other concrete examples are welcome |
@zewa666 those are components' internal implementations we are going to test right? |
When we talk about Slots it also means we do support all standard scenarios like text, pre/append and html. The attribute would then act as usual by replacing/modifying all the slot contents and placing the new. So I guess the first case should be doable pretty soon. The multi slot is something I'm not sure yet how to support since it would require a totally new syntax. How should the t attribute know, where to put what. Any ideas about that? Maybe it would also make sense to split this into two issues so things can be delivered sooner? I guess the default slot is something that happens fairly more often then a named case |
The simple slot example from the aurelia doc (http://aurelia.io/hub.html#/doc/article/aurelia/templating/latest/templating-content-projection/2) I think should work this way (supposing that the name Ralphie has a translation in every language): <name-tag t="ralphie">
Ralphie
</name-tag> At runtime the translation of The named slots example I think is working correctly, see this new gist https://gist.run/?id=65062bf05b1d4cddcd1c7c6d902b0ceb , at least the basic test case. Don't know the case with pre/post append, inner html etc. |
Exactly the same issue here, the use case @mar9000 above and @zewa666's "default slot, no container" are my use cases. edit: I can work around it for now btw, but would be nice to see it fixed someday. |
I'm submitting a feature request
Current behavior:
As you can see in this gist https://gist.run/?id=c7e1c50ba6073c7c27c0fd2bb277e002 the last checkbox is not displayed correctly. This depends on 2 things, one is the the implementation of the element
md-checkbox
:See https://github.com/aurelia-ui-toolkits/aurelia-materialize-bridge/blob/master/src/checkbox/checkbox.html
The ladder is the implementation of
i18n.updateValue()
that in case of translation of textContent executes:removing the internal implementation of the checkbox (input and label) at runtime.
See also discussion at the end of this issue #197 (comment) .
Workaround:
As one can see from the same gist the second-last checkbox is working because the element content (the label value) has been wrapped with a
span
element and the translation moved to this element.Expected/desired behavior:
As aurelia is actually projecting the element content to the
slot
element, aurelia-i18n should projects the textContent translation to theslot
preserving the internal representation of the custom element. At the moment a developer using aurelia-i18n should be aware of the internal implementation of an certain element when using textContent translation.The text was updated successfully, but these errors were encountered: