vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.31k stars 2.15k forks source link

What about using markdown extension syntax for multilingual translation? #4106

Closed ajiho closed 3 months ago

ajiho commented 3 months ago

Is your feature request related to a problem? Please describe.

I have reviewed the relevant parts of the document repeatedly, and I only found that it supports global setting of one language.

Although you can do your own translation later, it may seem a bit troublesome

::: info 信息
This is an info box.
:::

::: tip 提示
This is a tip.
:::

The advantages of using it this way are verbose

Describe the solution you'd like

themeConfig:{
          logo: { src: "/logo-mini.svg", width: 24, height: 24 },
           markdown: {
            container: {
                locales: {
                    root: {
                        tipLabel: "提示",
                        warningLabel: "警告",
                        dangerLabel: "危险",
                        infoLabel: "信息",
                        detailsLabel: "详细信息",
                    },
                    en:{
                        tipLabel: "Tip",
                        warningLabel: "Warning",
                        //...
                    }
                },
            },
        },
}

Describe alternatives you've considered

No response

Additional context

No response

Validations

brc-dd commented 3 months ago

Duplicate of #3861