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

为开发者构建的本地化

TypeScript SDK、CLI 工具、Git 同步(beta)和 MCP 工作流。无需离开开发流程,即可构建、翻译和发布。

Typed keysType use-intl's AppConfig from a pulled JSON file and the editor knows your keys; the app gets each one in every language from the edge.
01Developer surface

开箱即用的功能

  1. 01Type-Safe SDKsWritten in TypeScript; for key autocomplete, type use-intl's AppConfig from a file made by lefine strings pull
  2. 02Git-First WorkflowAutomatic key discovery from your codebase via AST parsing
  3. 03MCP IntegrationManage translations directly from Claude or Cursor
  4. 04CLI ToolsScan codebase, sync translations, and validate keys from terminal
  5. 05Edge CDNTranslation delivery from Cloudflare's global network
02

几分钟内即可开始

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

terminal
# Install the packagenpm install lefine# Sign in to your workspacenpx lefine login# Download the published translations as JSONnpx lefine strings pull# Check that every key your code uses existsnpx lefine strings check# Your code stays cleanimport { useStrings } from 'lefine/react';function Component() {  const t = useStrings('common');  return <h1>{t('welcome')}</h1>;}
03

边缘 CDN 性能

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

Manifest Cache
Cached 5 minutes by the SDK in production (set manifestCacheTtlMs), 60 seconds at the CDN edge
Translation Cache
60 seconds at the CDN edge; SDK cache keys follow the manifest version, so new content loads once the manifest is re-read
Global Propagation
Edge copies everywhere refresh within a minute of publish
Cache Purging
Publish purges the cached files; edge locations the purge does not reach expire them within 60 seconds
Batch Requests
/batch.json returns several namespaces in one request
Edge Locations
North America, Europe, and Asia Pacific
Versioned Snapshots
Per-publish files under /v/<version>/ cached for a year as immutable
04

REST API 与 Webhooks

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

rest-api
// MCP tools (npx lefine mcp, or https://dash.lefine.ai/v1/mcp)lefine_context()lefine_find(query)lefine_read(action, input)lefine_write(action, input)lefine_publish(action, input)lefine_find_similar_key(text)lefine_add_key(key, text)
  1. Webhook 事件在同步完成、翻译发布或键值发生修改时接收推送通知。
  2. 批量操作在单个请求中创建、更新或删除多个键。每个键在同步过程中由唯一 UUID 追踪。
  3. 同步状态追踪通过“待处理”、“进行中”、“已完成”和“失败”这四个状态监控同步任务。软删除的键会保留并附带时间戳,以便进行审计。
05

开发者体验

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

  1. Namespace ScopingAutomatic namespace binding via lexical scope analysis
  2. Rich Type SystemFull TypeScript types; npx lefine strings types writes every key of your app
  3. i18n.config.tsSingle workspace configuration file for all settings
  4. Debug LoggingVerbose output for troubleshooting integration issues
  5. Perf MonitoringThe scan and doctor commands report how long each run took
  6. Custom FetchBring your own HTTP client for translation loading
  7. Error HandlersCustom callbacks for missing translation keys
  8. Locale CallbacksEvent hooks for locale switching and changes
06

基础设施

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

  1. Cloudflare WorkersEdge computing with built-in DDoS protection and global distribution
  2. Cloudflare R2 StorageObject storage for translation files with zero egress fees
  3. Neon PostgreSQLServerless Postgres, reached from Workers through Cloudflare Hyperdrive
  4. Multi-DatacenterRedundant deployment across regions for high availability
07

支持的框架

开始使用

免费开始。

立即开始构建

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