Skip to content

How to mark strings within JavaScript code as translatable #1587

@gabalafou

Description

@gabalafou

Can you open a new issue to remind us to come back to this (question about marking strings as translatable if they're generated within JavaScript) please?

Originally posted by @drammock in #1454 (comment)

Summary

In 1454, I added a banner type landmark to the pink version warning banner and labeled it with the string "Version warning" (in pydata-sphinx-theme.js line 473).

When it is shown, the version warning banner displays: "This is documentation for an unstable development version," followed by a red button that reads "Switch to stable version"

The landmark label is not visible; it's only exposed by assistive technology, such as screen readers. But like all user-facing strings, the "Version warning" label needs to be added to the set of translatable strings, but I don't know how to do that in JavaScript.

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