(ast: html.Node[], msgMeta?: string)
| 388 | |
| 389 | // add a translatable message |
| 390 | private _addMessage(ast: html.Node[], msgMeta?: string): i18n.Message | null { |
| 391 | if ( |
| 392 | ast.length == 0 || |
| 393 | this._isEmptyAttributeValue(ast) || |
| 394 | this._isPlaceholderOnlyAttributeValue(ast) || |
| 395 | this._isPlaceholderOnlyMessage(ast) |
| 396 | ) { |
| 397 | // Do not create empty messages |
| 398 | return null; |
| 399 | } |
| 400 | |
| 401 | const {meaning, description, id} = _parseMessageMeta(msgMeta); |
| 402 | const message = this._createI18nMessage(ast, meaning, description, id); |
| 403 | this._messages.push(message); |
| 404 | return message; |
| 405 | } |
| 406 | |
| 407 | // Check for cases like `<div i18n-title title="">`. |
| 408 | private _isEmptyAttributeValue(ast: html.Node[]): boolean { |
no test coverage detected