In the controller there is $ scope which you want to output \ transmit in a certain language, despite the fact that language is currently selected by the user.
How to implement it? How to translate the piece I need (then a variable or something else) to the desired language?
read Hyde and found something about Instant (TranslationID, InterpolateParams, InterpoPolationID, Forcelanguage, Sanitizestrategy)
So far I can not understand how to use it.
Answer 1
$ translate.instant (translationid, interpolateparams, interpolationid, forcelanguage, sanitizestrategy);
-
translationid – what to translate
-
interpolateparams – the parameters that will be used in the translation template. For example, if the translation text is:
count: {{count}}
You can transfer the value to be used instead of Count and get “Count: 10”, or “Count: 20” -
interpolationid – ID of a specific interpolator (if any)
-
forcelanguage – language to which change
-
sanitizestrategy is a view in which we give