(ast: html.Node[], msgMeta?: string)
| 417 | |
| 418 | // add a translatable message |
| 419 | private _addMessage(ast: html.Node[], msgMeta?: string): i18n.Message | null { |
| 420 | if ( |
| 421 | ast.length == 0 || |
| 422 | this._isEmptyAttributeValue(ast) || |
| 423 | this._isPlaceholderOnlyAttributeValue(ast) || |
| 424 | this._isPlaceholderOnlyMessage(ast) |
| 425 | ) { |
| 426 | // Do not create empty messages |
| 427 | return null; |
| 428 | } |
| 429 | |
| 430 | const {meaning, description, id} = _parseMessageMeta(msgMeta); |
| 431 | const message = this._createI18nMessage(ast, meaning, description, id); |
| 432 | this._messages.push(message); |
| 433 | return message; |
| 434 | } |
| 435 | |
| 436 | // Check for cases like `<div i18n-title title="">`. |
| 437 | private _isEmptyAttributeValue(ast: html.Node[]): boolean { |
no test coverage detected