Skip to content

Double language change will not translate with directive on untrimmed value #1091

@Snap252

Description

@Snap252

Current behavior

Having an untrimmed text value will lead to bad behavior when changing the language twice
'untrimmed':
<button translate>text </button>

Expected behavior

  • translation will not work once
  • or translation will work as often as you change language

How do you think that we should fix this?

As i took a look at the code it seems like a caching / comparing problem.
So fix the code.

Minimal reproduction of the problem with instructions

Environment


ngx-translate version: ^11.0.1
Angular version: 8.0.1


Browser:
- [X] Chrome (desktop) version 75.0.3770.100 (Offizieller Build) (64-Bit)
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [X] Firefox version 66.0.5 (64-Bit)
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [X] IE version 11.0.9600.19377
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  v10.15.3
- Platform:  Windows

Others:

minimal code:

minimal.ts.txt

maybe it depends on #808 but hopefully more reproducable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions