Skip to content

HTML template elements are not localized #4

Description

@tdulcet

HTML template elements are not localized as expected:

<template>
	<span data-i18n="__MSG_example__">Please translate me!</span>
</template>

The issue is that they are not found by document.querySelectorAll:

Localizer/Localizer.js

Lines 283 to 286 in f6da4ca

document.querySelectorAll(`[${I18N_ATTRIBUTE}]`).forEach((currentElem) => {
const contentString = currentElem.dataset[I18N_DATASET];
replaceI18n(currentElem, contentString);
});

This affects my Thunderbird Send add-on, which uses an HTML template element in the popup. See tdulcet/Thunderbird-Send#14.

CC: @DenB10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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