Skip to content

drawLocal Translations #379

@FriiZe

Description

@FriiZe

Hello,
I want to translate buttons label and tooltips and did it that way :

L.drawLocal.draw.toolbar.actions.title = this.translateService.instant(
      'app.map.draw.toolbar.actions.title',
    );
    L.drawLocal.draw.toolbar.actions.text = this.translateService.instant(
      'app.map.draw.toolbar.actions.text',
    );
    L.drawLocal.draw.toolbar.finish.title = this.translateService.instant(
      'app.map.draw.toolbar.finish.title',
    );
    L.drawLocal.draw.toolbar.finish.text = this.translateService.instant(
      'app.map.draw.toolbar.finish.text',
    );
    L.drawLocal.draw.toolbar.undo.title = this.translateService.instant(
      'app.map.draw.toolbar.undo.title',
    );
    L.drawLocal.draw.toolbar.undo.text = this.translateService.instant(
      'app.map.draw.toolbar.undo.text',
    );
    L.drawLocal.draw.toolbar.buttons.polygon = this.translateService.instant(
      'app.map.draw.toolbar.buttons.polygon',
    );

where L is :

import * as L from 'leaflet';

In local, it's working successful. However, in production build, got the following error

ERROR TypeError: Cannot read properties of undefined (reading 'draw')
    at o.configureLeafletDrawLocalization

and drawLocal is undefined.
Any idea of a resolution way ?
Thanks for answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions