> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## 引入全局语言同步：跟随您的代码语言偏好

从今天开始，当您在任何 `<CodeBlocks>` 或 `<Tabs>` 中选择编程语言时，该偏好将自动在所有文档页面间同步。这意味着您在浏览文档的不同部分时，无需再手动切换语言。无论您是在查看实现示例、调试指南还是 API 参考，您的首选语言都会跟随您。语言偏好保存在客户端本地存储中。

此行为对所有 `<CodeBlocks>` 自动启用。要为 `<Tab>` 添加语言偏好，您可以添加 `language` 属性。在下面的示例中查看语言同步效果：

#### 示例

#### TypeScript

这是 TypeScript 专用内容。

#### Python

这是 Python 专用内容。

#### Java

这是 Java 专用内容。

```typescript
console.log("Hello, world!");
```

```python
print("Hello, world!")
```

```java
System.out.println("Hello, world!");
```

```typescript
console.log("This content is synced!");
```

```python
print("This content is synced!");
```

```java
System.out.println("This content is synced!");
```

#### Markdown

````md
<Tabs>
<Tab title="TypeScript" language="typescript">
This is content specific to TypeScript. 
</Tab>
<Tab title="Python" language="python">
This is content specific to Python. 
</Tab>
<Tab title="Java" language="java">
This is content specific to Java. 
</Tab>
</Tabs>

<CodeBlocks>
```typescript
console.log("Hello, world!");
```
```python
print("Hello, world!")
```
```java
System.out.println("Hello, world!");
```
</CodeBlocks>

<CodeBlocks>
```typescript
console.log("This content is synced!");
```
```python
print("This content is synced!");
```
```java
System.out.println("This content is synced!");
```
</CodeBlocks>
````

阅读文档