@@ -4,6 +4,7 @@ import { FluentResource } from "./resource.js";
4
4
import { FluentValue , FluentNone , FluentFunction } from "./types.js" ;
5
5
import { Message , Term , Pattern } from "./ast.js" ;
6
6
import { NUMBER , DATETIME } from "./builtins.js" ;
7
+ import { getMemoizerForLocale , IntlCache } from "./memoizer.js" ;
7
8
8
9
export type TextTransform = ( text : string ) => string ;
9
10
@@ -22,12 +23,7 @@ export class FluentBundle {
22
23
public _functions : Record < string , FluentFunction > ;
23
24
public _useIsolating : boolean ;
24
25
public _transform : TextTransform ;
25
- public _intls = new WeakMap <
26
- | typeof Intl . NumberFormat
27
- | typeof Intl . DateTimeFormat
28
- | typeof Intl . PluralRules ,
29
- Record < string , Intl . NumberFormat | Intl . DateTimeFormat | Intl . PluralRules >
30
- > ( ) ;
26
+ public _intls : IntlCache ;
31
27
32
28
/**
33
29
* Create an instance of `FluentBundle`.
@@ -78,6 +74,7 @@ export class FluentBundle {
78
74
} ;
79
75
this . _useIsolating = useIsolating ;
80
76
this . _transform = transform ;
77
+ this . _intls = getMemoizerForLocale ( locales ) ;
81
78
}
82
79
83
80
/**
0 commit comments