@@ -41,16 +41,10 @@ export interface I18nMessageFactory {
4141 * Returns a function converting html nodes to an i18n Message
4242 */
4343export function createI18nMessageFactory (
44- containerBlocks : Set < string > ,
4544 retainEmptyTokens : boolean ,
4645 preserveExpressionWhitespace : boolean ,
4746) : I18nMessageFactory {
48- const visitor = new _I18nVisitor (
49- _expParser ,
50- containerBlocks ,
51- retainEmptyTokens ,
52- preserveExpressionWhitespace ,
53- ) ;
47+ const visitor = new _I18nVisitor ( _expParser , retainEmptyTokens , preserveExpressionWhitespace ) ;
5448 return ( nodes , meaning , description , customId , visitNodeFn ) =>
5549 visitor . toI18nMessage ( nodes , meaning , description , customId , visitNodeFn ) ;
5650}
@@ -71,7 +65,6 @@ function noopVisitNodeFn(_html: html.Node, i18n: i18n.Node): i18n.Node {
7165class _I18nVisitor implements html . Visitor {
7266 constructor (
7367 private _expressionParser : ExpressionParser ,
74- private _containerBlocks : Set < string > ,
7568 private readonly _retainEmptyTokens : boolean ,
7669 private readonly _preserveExpressionWhitespace : boolean ,
7770 ) { }
@@ -183,7 +176,7 @@ class _I18nVisitor implements html.Visitor {
183176 visitBlock ( block : html . Block , context : I18nMessageVisitorContext ) {
184177 const children = html . visitAll ( this , block . children , context ) ;
185178
186- if ( this . _containerBlocks . has ( block . name ) ) {
179+ if ( block . name === 'switch' ) {
187180 return new i18n . Container ( children , block . sourceSpan ) ;
188181 }
189182
0 commit comments