Skip to content

Suggestion: avoid __MSG_*__ format #1

@ivilata

Description

@ivilata

Hi! First of all, hats off to this module, it makes dynamic translation of extension HTML messages very efficient and flexible. 😄 We are using it in this extension and it works like a charm.

I was wondering whether the __MSG_*__ format in message ids really adds anything. I know it's necessary for text replacement in the manifest.json and CSS files, but with data-i18n* attributes explicitly and only referring to message ids, the format can be entirely avoided, thus avoiding a lot of noise in the HTML file. As you can see, we altered Localizer to remove that requirement and it works perfectly, even with predefined messages like @@ui_locale.

For backwards compatibility, getMessageTag may remove the __MSG_*__ wrapper if present as it does now, otherwise just use the tag as is. If you like the idea I can provide a PR, but my JS abilities are very limited.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions