Skip to content

Add possibility to pass a desired target language to TranslatePipe #233

Open
@mzellho

Description

@mzellho

I'm submitting a ... (check one with "x")

[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[x] feature request

Current behavior
Using the TranslatePipe, there is no possibility to get a translation for a language other than the one that is set up - one can only pass interpolateParams to TranslatePipe.

Expected/desired behavior
It would be cool if one could also pass the token of the desired langauge for the translation to the pipe in case you need to translate a key to two (or more) different languages on the same page. Of course, this could be handled via the TranslateService using a method or another custom pipe, but passing the langauge token to the pipe would be a more elegant solution for the user.

<p>english: {{ some.key | translate }}</p>
<p>french: {{ some.key | translate:'fr' }}</p>
<p>german: {{ some.key | translate:'de' }}</p>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions