Romanchuk / angular-i18next

angular v10+ integration with i18next v19.4+
MIT License
131 stars 33 forks source link

i18next for t.options not working anymore in 9.0.0 #48

Closed tmtron closed 4 years ago

tmtron commented 4 years ago

Translatingt.options like this:

`{{ 'operation.editTarget' | i18nextCap: { target: 'control.title' | i18next } }}

was working in versions 7.0.0 and 8.0.1 - but does not work anymore in 9.0.0.

Note: we want to pass a translated text to the target variable of operation.editTarget.

Is this a regression, or is there now another way to do this?

Other versions:

Romanchuk commented 4 years ago

Hello, what is 'operation.editTarget' value?

tmtron commented 4 years ago

I've created Stackblitz examples with version 7.0.0 and 9.0.0

In Stackblitz-Example with version 7.0.0 the text is okay:

2020-02-23_18h02_17

In Stackblitz-Example with version 9.0.0, the text is not okay; the parameter target is missing:

image

The 2 examples are the same, except for the angualr-i18next versions.

In the console of version v9.0.0 we see a warning

i18next::interpolator: missed to pass in variable target for interpolating edit {{target}}
pheinicke commented 4 years ago

I can confirm this issue. Upgraded from 7.0.0 to 9.0.0. Options are no longer working.

"appName": "${context}",
"appName_task": "Task",
"appName_news": "News",
...

'appName' | i18next:{context:'news'} was translated correctly to "News" in 7.0.0, now (9.0.0) it's "${context}"

Romanchuk commented 4 years ago

@pheinicke @tmtron Thank you both, i'll take it to work today. You can safely downgrade to 7 or 8 version until i fix it.

Romanchuk commented 4 years ago

@pheinicke @tmtron Fixed in 9.0.1. Check it out!

pheinicke commented 4 years ago

It's working for me. Thanks for the quick fix!

tmtron commented 4 years ago

Working for me. Thanks for the fast response time!