fix(ivy): i18n - remove `translate` function when clearing translations (#34346)

The `loadTranslations()` function will attach the `translate()` function
to `$localize.translate` to cause runtime translation to occur.

We should cleanup after ourselves by unattaching this function when
we call `clearTranslations()`.

Fixes #32781

PR Close #34346
This commit is contained in:
Pete Bacon Darwin 2019-12-11 10:38:58 +00:00 committed by Kara Erickson
parent 656607b640
commit 6ce940315b
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ export function loadTranslations(translations: Record<MessageId, TargetMessage>)
* @publicApi
*/
export function clearTranslations() {
$localize.translate = undefined;
$localize.TRANSLATIONS = {};
}