跳转至主要内容
对于开发者

为开发者构建的本地化

无需离开 ide 即可发布翻译。

Type-Safe SDKs

Full TypeScript support with autocomplete for translation keys

Git-First Workflow

Automatic key discovery from your codebase via AST parsing

MCP Integration

Manage translations directly from Claude or Cursor

CLI Tools

Scan codebase, sync translations, and validate keys from terminal

Edge CDN

Sub-50ms translation delivery from Cloudflare's global network

Hot Reload

See translation changes instantly during development

几分钟内即可开始

设置简单,功能强大。无需复杂的配置。

# Install the SDK
npm install @better-i18n/next

# Configure your project
npx better-i18n init

# Scan for translation keys
npx better-i18n scan

# Your code stays clean
import { useTranslations } from '@better-i18n/use-intl';

function Component() {
  const t = useT('common');
  return <h1>{t('welcome')}</h1>;
}

边缘 CDN 性能

翻译内容通过 Cloudflare 全球边缘网络提供服务,采用积极缓存和智能缓存失效策略,确保用户始终获得最快的加载速度。

Manifest Cache5-minute TTL with smart invalidation on publish
Translation Cache1-hour TTL for optimal repeat-visit performance
Global Propagation5-10 second cache propagation after publish
Cache PurgingPublish triggers global invalidation instantly
Preload Support<link rel=preload> for faster initial loading
Edge LocationsNorth America, Europe, and Asia Pacific
Immutable Assets1-year cache for static assets like flags

REST API 与 Webhooks

通过编程方式访问所有平台功能。您可以通过自有工具或持续集成(CI)管道来管理项目、密钥和语言。

// REST API methods
listProjects()
getProject(id)
addLanguage(projectId, locale)
listKeys(projectId)
createKeys(projectId, keys[])
updateKeys(projectId, keys[])
deleteKeys(projectId, keyIds[])

Webhook 事件

在同步完成、翻译发布或键值发生修改时接收推送通知。

批量操作

在单个请求中创建、更新或删除多个键。每个键在同步过程中由唯一 UUID 追踪。

同步状态追踪

通过“待处理”、“进行中”、“已完成”和“失败”这四个状态监控同步任务。软删除的键会保留并附带时间戳,以便进行审计。

开发者体验

专为注重类型安全、调试和性能可观测性的开发者打造。

Namespace Scoping

Automatic namespace binding via lexical scope analysis

Rich Type System

Full TypeScript types exported from @better-i18n/core

i18n.config.ts

Single workspace configuration file for all settings

Debug Logging

Verbose output for troubleshooting integration issues

Perf Monitoring

Execution time and cache hit rate reporting

Custom Fetch

Bring your own HTTP client for translation loading

Error Handlers

Custom callbacks for missing translation keys

Locale Callbacks

Event hooks for locale switching and changes

基础设施

生产级基础设施,内置安全性、冗余和多数据中心支持。

Cloudflare Workers

Edge computing with built-in DDoS protection and global distribution

Cloudflare R2 Storage

Object storage for translation files with zero egress fees

PlanetScale Database

Serverless MySQL with automatic backups and branching

Multi-Datacenter

Redundant deployment across regions for high availability

立即开始构建

免费层级包含大量限额。无需信用卡。