Feature request: add ability to pass language code to the pipe
See original GitHub issueCurrently, the translate pipe reads the language code from LocaleService which is fine as a default behavior
But with being the only available behavior This caused a limitation, where some areas in the view need to translate to certain language (language is already supported in the app) but no way to do so without changing the entire language in the app
We managed to add such feature in-house, with this syntax
"UserName" | translate : "ar"
But it will be much better to be supported in the library, to avoid duplicating the effort of modifying the pipe again after each new release
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
[Feature request] Add locale selection in settings #68 - GitHub
Since YouTube deliberately assings language based on user's location, I always get russian videos, even while search query is in pure English.
Read more >Transforming Data Using Pipes - Angular
Some pipes require at least one parameter and allow more optional parameters, such as SlicePipe . For example, {{ slice:1:5 }} creates a...
Read more >Language Processing Pipelines · spaCy Usage Documentation
spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more....
Read more >Feature flags - GitLab Docs
On the left sidebar, select Deployments > Feature Flags. Edit the feature flag you want to remove. Select More actions ( ). Select...
Read more >Language Server Protocol Specification - 3.17
A capability groups a set of language features. ... A parameter literal used in requests to pass a text document and a position...
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

Hello. When you add this:
LocalizationServicecalls the translate pipe through Change Detection, and passes the languageCode property. If you intend to force a value to the language of the translate pipe, with pure pipes it will not work, because the pipetransformmethod is invoked only when Change Detection detects a change in the input parameters.Is it possible for the translate pipe to use the localization.languageCode by default? For example:
<span>{{‘DASHBORAD_TOTAL_TITLE’ | translate}}</span>
Would be equivalent to:
<span>{{‘DASHBORAD_TOTAL_TITLE’ | translate:localization.languageCode}}</span>