| 287 | } |
| 288 | |
| 289 | class LocalizeMessageStringVisitor implements Visitor { |
| 290 | visitText(text: Text): any { |
| 291 | return text.value; |
| 292 | } |
| 293 | |
| 294 | visitContainer(container: Container): any { |
| 295 | return container.children.map((child) => child.visit(this)).join(''); |
| 296 | } |
| 297 | |
| 298 | visitIcu(icu: Icu): any { |
| 299 | const strCases = Object.keys(icu.cases).map( |
| 300 | (k: string) => `${k} {${icu.cases[k].visit(this)}}`, |
| 301 | ); |
| 302 | return `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`; |
| 303 | } |
| 304 | |
| 305 | visitTagPlaceholder(ph: TagPlaceholder): any { |
| 306 | const children = ph.children.map((child) => child.visit(this)).join(''); |
| 307 | return `{$${ph.startName}}${children}{$${ph.closeName}}`; |
| 308 | } |
| 309 | |
| 310 | visitPlaceholder(ph: Placeholder): any { |
| 311 | return `{$${ph.name}}`; |
| 312 | } |
| 313 | |
| 314 | visitIcuPlaceholder(ph: IcuPlaceholder): any { |
| 315 | return `{$${ph.name}}`; |
| 316 | } |
| 317 | |
| 318 | visitBlockPlaceholder(ph: BlockPlaceholder): any { |
| 319 | const children = ph.children.map((child) => child.visit(this)).join(''); |
| 320 | return `{$${ph.startName}}${children}{$${ph.closeName}}`; |
| 321 | } |
| 322 | } |
nothing calls this directly
no outgoing calls
no test coverage detected