Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

$translate.instant doesn't apply fallback language translation in case of translateNotFoundIndicators usage since 2.6.0 #1314

Closed
shkrobova opened this issue Nov 30, 2015 · 3 comments

Comments

@shkrobova
Copy link
Contributor

Translation table contains two languages with codes 'en' and 'de', using 'en' as fallback language and 'de' as current.Translation for key exists only for fallback language. Also translateNotFoundIndicators are configured. But when I attempt to get translation using translate filter, I get translation key, which is wrapped into indicators. Expectation is to get fallback language translation.
Issue reproduced in the plunker: example.

@tspaeth
Copy link
Member

tspaeth commented Nov 30, 2015

If your remove the translationNotFoundIndicator it will work correctly. I assume that the translationNotFoundIndicator currently just detects if your active language doesn't contain the key and then print the indicator here.

shkrobova added a commit to shkrobova/angular-translate that referenced this issue Dec 1, 2015
knalli pushed a commit that referenced this issue Dec 13, 2015
…nguage checked in $translate.instant method

Fixes #1314
@knalli knalli added this to the 2.9.0 milestone Dec 13, 2015
@knalli
Copy link
Member

knalli commented Dec 13, 2015

PR is landed.

@knalli knalli closed this as completed Dec 13, 2015
@jimmykane
Copy link

jimmykane commented Apr 27, 2017

The resolution of this by e3c2063 has resulted into when an indicator is not set then the id is interpolated and sanitised opposing to the rest of the reject returns where they just call the applyNotFoundIndicators method. Also bypysses the rejection handler translateByHandler.

I will be refactoring this so that it follows the specs of all other calls most important following sanitization strategy and regards to issues: #730 and #1297 and commit: 01fecd0 to be able to resolve #1722

Worth to mention in order to prevent a breaking change.

@shkrobova I need to mention as well that as discussed in #1722 with @knalli I will provide a $sanitizeNotFound opt out for the user.

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

No branches or pull requests

4 participants