* _getAnnotation * An annotation is a text associated with the edit, such as "Started a line". * @return {string?} String such as "Started a line", or undefined if the drawWay is incomplete
()
| 273 | * @return {string?} String such as "Started a line", or undefined if the drawWay is incomplete |
| 274 | */ |
| 275 | _getAnnotation() { |
| 276 | const context = this.context; |
| 277 | const editor = context.systems.editor; |
| 278 | const graph = editor.staging.graph; |
| 279 | const l10n = context.systems.l10n; |
| 280 | |
| 281 | const drawWay = this.drawWayID && graph.hasEntity(this.drawWayID); |
| 282 | const length = drawWay?.nodes?.length || 0; |
| 283 | if (length < 2) return undefined; |
| 284 | |
| 285 | const which = length > 2 ? 'continue' : 'start'; |
| 286 | return l10n.t(`operations.${which}.annotation.line`); |
| 287 | } |
| 288 | |
| 289 | |
| 290 | /** |
no test coverage detected