Translate filter incorrectly assumes this===scope
See original GitHub issueSubject of the issue
When using the translate filter with a string argument, the filter uses $parse to parse the string, then evaluates the expression against this, assuming this is the current scope. But that is an incorrect assumption since Angular 1.3, see this commit:
https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f
Your environment
- version of angular-translate: 2.9.0
- version of angular: 1.5.0
- which browser and its version: Chrome 53
Steps to reproduce
Example: https://plnkr.co/edit/vBoO2V?p=preview
(The example show the non-working string-parse case and contrasts with the working object case.)
Expected behaviour
Since it’s not possible to evaluate the parsed string against the scope, the filter should probably throw an exception.
Actual behaviour
The parsed string is evaluated against this, which is undefined, which means that scope variables are not resolved.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
LogStash translate filter ignored - Stack Overflow
Im trying to add a simple translation filter to convert port number in application name: filter { mutate { add_field ...
Read more >Translate filter plugin | Logstash Reference [8.5] - Elastic
A general search and replace tool that uses a configured hash and/or a file to determine replacement values. Currently supported are YAML, ...
Read more >Function 'chi2test' has already been declared within this scope ...
a reasonable assumption regarding the population distribution of a random sample X. % with the desired significance level ALPHA.
Read more >one common problem - Polish translation – Linguee
Many translated example sentences containing "one common problem" – Polish-English dictionary and search engine for Polish translations.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sure, I’ll fix!
5cb94cb