Skip to content

Commit

Permalink
fix(ivy): i18n - remove translate function when clearing translatio…
Browse files Browse the repository at this point in the history
…ns (angular#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 angular#32781

PR Close angular#34346
  • Loading branch information
petebacondarwin authored and kara committed Dec 11, 2019
1 parent 656607b commit 6ce9403
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/localize/src/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function loadTranslations(translations: Record<MessageId, TargetMessage>)
* @publicApi
*/
export function clearTranslations() {
$localize.translate = undefined;
$localize.TRANSLATIONS = {};
}

Expand Down

0 comments on commit 6ce9403

Please sign in to comment.