Skip to content
Permalink
Browse files

fix(ivy): i18n - remove `translate` function when clearing translatio…

…ns (#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
  • Loading branch information
petebacondarwin authored and kara committed Dec 11, 2019
1 parent d55370e commit 1489e5e96928d7bca406d92e67be5ee8f8dd9294
Showing with 1 addition and 0 deletions.
  1. +1 −0 packages/localize/src/translate.ts
@@ -52,6 +52,7 @@ export function loadTranslations(translations: Record<MessageId, TargetMessage>)
* @publicApi
*/
export function clearTranslations() {
$localize.translate = undefined;
$localize.TRANSLATIONS = {};
}

0 comments on commit 1489e5e

Please sign in to comment.
You can’t perform that action at this time.