Skip to content
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

Using prepend in IE is not working as expected. #248

Open
mpoelman opened this issue Dec 15, 2017 · 6 comments
Open

Using prepend in IE is not working as expected. #248

mpoelman opened this issue Dec 15, 2017 · 6 comments

Comments

@mpoelman
Copy link

mpoelman commented Dec 15, 2017

I'm submitting a bug report

  • Library Version:
    2.1.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.11.0

  • NPM Version:
    3.10.10

  • Browser:
    IE 11.64.16299.0

  • Language:
    TypeScript 2.6.1

Current behavior:
Using [prepend] within a 't' attribute in IE is not working as expected.
For example:
<span class="col" t="[prepend]entities:person.title-${customer.person.gender}">${customer.person.formalFullName}</span>

Results in the following in IE:
Mevr.Mevr.Dhr.Dhr.Mevr.Dhr.Mevr.person.title-

Context: 'Mevr.' and 'Dhr.' are the Dutch equivalent to 'Ms' and 'Mr'

I think there are two issues with this.

  1. Prepend is called multiple times (or the current text within a span is not cleared).
  2. The translation key is also added to the result.

This does not happen in Chrome, Firefox and Edge.

Expected/desired behavior:

  • What is the expected behavior?
    I would expect the result to be (depending on a person's gender) either 'Dhr. ' or 'Mevr. '

  • What is the motivation / use case for changing the behavior?
    Consistent usage of [prepend] accross multiple browsers.

@zewa666
Copy link
Member

zewa666 commented Dec 17, 2017

I wasn't able to replicate the issue, I guess it must have to do something with the workflow of your app. Could you create a simplified example depicting the issue so I can take a look at it?

@mpoelman
Copy link
Author

mpoelman commented Dec 18, 2017

Thank you for your answer.

I can't replicate this issue as well (in a new project). I'm using the same versions of i18next and aurelia-i18n in both projects. I will update when I fixed the issue or when I can replicate it.

Edit:
The only thing that I can say about it is that it's only occurring when using [append] or [prepend] in combination with "${customer.person.gender}". I've used dynamic translation keys without any problems in IE before.
However, in my new project, it is working as expected. Only thing different between the projects is that in the project with the issue, I'm fetching data from a server, in my new project it is just static data.

Personally I think this issue can be left open in case anyone else stumbles upon this issue.

@zewa666
Copy link
Member

zewa666 commented Jan 31, 2018

Closing this for now, lets reopen If it pops up again

@zewa666 zewa666 closed this as completed Jan 31, 2018
@WizzApp
Copy link
Contributor

WizzApp commented Feb 22, 2018

I stumbled (presumably) over this issue when doing an update on an element after changing the locale in IE11 and using append/prepend.

See this repository for an Aurelia CLI project to reproduce the issue.

@arnederuwe
Copy link

I can also reproduce this issue in IE, sometimes, the prepended translation is rendered twice. seems like a race condition, because it doesn't happen all the time

@zewa666 zewa666 reopened this Mar 22, 2018
@pndewit
Copy link

pndewit commented Jun 29, 2018

Any updates on this? Also having issues with [append] getting translated twice in IE11.

<span t.bind="'[append]' + item.name">Name: </span>

results in

Name: TestTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants