You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
当页面初始化或切换语言时,为 html 添加对应语言类,编写对应 CSS 以在该类下显示对应语言的区块。
@@ -315,7 +315,7 @@ So I tried to solve the problem using pure CSS.
315
315
<divlang="en">
316
316
317
317
::: tip IDEA
318
-
That is, with the help of CSS rules, the content of the corresponding block is displayed according to the corresponding language.
318
+
That is, with the help of CSS rules, the content of the corresponding block is displayed according to the corresponding language.
319
319
The general solution: set fence to pre-compile Markdown via [markdown-it-container](https://github.com/markdown-it/markdown-it-container).
320
320
Wrap new `<div lang="zh-CN"></div>`s for the paragraphs that need to be i18n and hide them by default with CSS.
321
321
When the page initializes or switches languages, add the corresponding language class to html and write the corresponding CSS to display the corresponding language block under that class.
@@ -426,7 +426,7 @@ To be able to handle i18n with CSS, we use markdown-it-container's fence to wrap
426
426
:::
427
427
428
428
```ts
429
-
exportconst containerPlugin=(md:MarkdownIt)=> {
429
+
exportfunction containerPlugin(md:MarkdownIt) {
430
430
// ...
431
431
const languages = ['zh-CN', 'en']
432
432
@@ -540,7 +540,7 @@ When switching languages, the following can be done.
0 commit comments