Skip to content

Feature Request: Support Dynamic Image Localization #793

@vexr

Description

@vexr

Docusaurus currently lacks a solution for dynamically switching images based on the active locale. This enhancement would allow images to be served according to the user's selected language, ensuring a more seamless localization experience.

The improvement would focus on automatically localizing images referenced in MDX or Markdown files by adjusting image paths based on the active locale. If locale-specific images are unavailable, the system would default to the English version as a fallback. The images would be organized in locale-specific static paths (e.g., /img/en/space-acres/image1.png and /img/vi/space-acres/image1.png), streamlining content management without additional manual steps.

This enhancement would benefit several aspects:

  • Improved Localization: Users would see images that are localized to their selected language, improving the experience for multi-language guides.
  • Easier Maintenance: The workflow would be simplified, as the system would handle image path localization, requiring only that the images be placed in the correct locale-specific directories.

Additionally, while users of the docs would also benefit from embedded YouTube video links being dynamically updated based on the locale, automating this for videos may be more challenging without custom components.

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