Hi there Yuxuan He,
Very nice to hear from you.
I can help you with this. In the English version, let’s look at the first embedded sample as an example. There are two things you need to do, in each case.
1.
The macro call that creates the live sample is this:
{{EmbedLiveSample(“Gradient_at_a_45-degree_angle”)}}
what it does is grab the code in the section of the document underneath the heading with an ID of “Gradient_at_a_45-degree_angle”, and embed the rendered result inside an <iframe>.
If you look at the source code of the document, you’ll be able to find these. There is a heading above the embedded example like so:
<h3 id=“Gradient_at_a_45-degree_angle”>Gradient at a 45-degree angle</h3>
Below this heading are the following code blocks:
<div style=“width: 200px; height: 200px;”></div>
div {
background: linear-gradient(135deg, red, blue);
}
These are blocks that are rendered inside the iframe.
SO
You need to update the IDs inside the macro calls in the zh-CN translation so they are equal to the zh-CN IDs, NOT the English IDs.
2.
You need to label the code blocks with the correct syntax highlighting for each one (HTML, CSS, etc.) This is done by placing your cursor inside the syntax block, and selecting the right option from the drop-down menu to the right of the “h5” button. when you successfully apply the highlighting, it will be shown in the top right of the code block in the edit mode.
I’ve highlighted both of these in the following screenshot.
I’ve done this one for you as an example: