# General Translation Changelog: gt-node 0.6.0: 使用 tx() 进行 runtime 翻译
URL: https://generaltranslation.com/zh/blog/gt-node_v0_6_0.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 
Authors: Ernest McCarter
Published: 2026-04-14

## 概述

`gt-node` 现在提供了 [`tx()`](/docs/node/reference/functions/tx)——一个可在 runtime 翻译字符串的函数。将任意字符串传给 [`tx()`](/docs/node/reference/functions/tx)，即可获得翻译后的版本，无需 build 步骤。

这让你能够在服务器端翻译动态内容：用户生成的文本、数据库中的值、API 响应，或任何无法预先确定的内容。

## 用法

### 基本用法

```js
import { tx } from 'gt-node';

const translated = await tx('Processing complete');
```

### 使用变量

```js
const translated = await tx('Hello, {name}!', { name: 'María' });
```

### 指定区域设置

```js
const status = await tx('Order shipped', { $locale: 'ja' });
```

## 链接

* [PR #1207](https://github.com/generaltranslation/gt/pull/1207)

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
