Byline CMS
  • 首页
  • 文档
  • 关于
Byline CMS
在 GitHub 上查看
  • Getting Started
    • Overview
    • CLI
    • Development environment and example application
    • Configuration
    • Upgrading from 3.21 to 4.x
    • Upgrading from 4.11 to 4.12
    • Upgrading from 4.19 to 5.x
    • PostgreSQL v5 Cutover
    • MySQL v5 Cutover
    • Upgrading from 5.2 to 6.x
  • Why Byline
    • Overview
    • Mission & Vision
    • Content Management in the Time of AI
    • Byline for Collections
  • Key Architectural Decisions
    • Overview
    • Core Document Storage
    • Core Composition
    • Transactions
    • Path Grammar
    • Content history and document controls
    • Deployment Topologies
  • Collections
    • Overview
    • Fields
    • Blocks
    • Relationships
    • Document Trees
    • Document Paths
    • File / Media Uploads
    • Rich Text Editor
    • Collection Versioning
    • Singletons
  • Reading & Delivery
    • Overview
    • Client SDK (@byline/client)
    • Routing & API
    • Transports
    • Markdown Export
    • MCP Server
    • Caching
  • Search
    • Overview
    • Configure search
    • Indexing and reindexing
    • Search API
    • Search provider contract
    • Portable multilingual search analysis
    • PostgreSQL and MySQL search providers
    • Attachment extraction for search
    • Native search engines and backend portability
    • Semantic discovery and institutional standards
    • Extraction provider contract
  • Auth & Security
    • Overview
    • Authentication & Authorization
    • Auditability
    • Passkeys
  • Internationalization (i18n)
    • Overview
    • The host i18n system
    • Admin interface translations
    • Content locales
    • Administering content locales
  • Admin UI
    • Overview
    • UI Kit (@byline/ui)
    • Admin-config registration
    • Collection groups
    • Richtext field capabilities
    • Editor view state
  • API Reference
    • Overview
    • Configuration API
    • Collections API
    • Fields API
    • Client SDK API
  • Scheduling
    • Overview
    • Recurring tasks
    • Scheduled publication
  • Analytics
    • Overview
    • Analytics configuration
    • Analytics browser agent and consent
    • Analytics ingest and deployment
    • Analytics storage, rollups, and operations
  • Testing
  • 首页

Internationalization (i18n)

Companions:

  • Configuration — how locales.ts, i18n.ts, and public.ts divide public-safe data from admin translation registration.
  • Configuration API — the exact i18n.admin, i18n.content, locale-definition, and translation-bundle properties.
  • Document paths — how source locale and path resolution interact.

Byline's i18n grew out of a recurring requirement: sites where content is translated independently of the interface it is presented in. Supporting that cleanly is one of the reasons Byline exists.

The result separates interface translations from content translations. A site can present content in one or more translations that lie entirely outside its own interface translations, and it does so correctly: additionally-translated pages get the right hreflang, canonical, and sitemap entries (everything needed to make a translated document discoverable) while preventing a content translation from becoming a "switched", unknown interface locale that sticks to the rest of the site as the visitor navigates.

Three independent axes

There are two separate-but-coordinated translation systems, plus a third, independent axis:

  • The host system — your application. It owns the public site's chrome language and URL strategy, and it needs to be aware of the content languages Byline can serve so it can route to and advertise them.
  • Byline's admin interface system — completely isolated from the host, used exclusively to render Byline's own admin-interface chrome.
  • Content locales — the languages a document can be published in. Defined inside Byline, separate from and independent of the admin-interface translations.

All three can differ. A realistic configuration:

Axis

Owner

Example

Host interface translations

the host frontend

en, fr

Byline admin interface translations

@byline/i18n

en, fr, es, de, …

Byline content translations

Byline storage / read pipeline

en, fr, es, de, zh-CN, ja-JP, ko-KR

The three sets overlap only by coincidence. An editor working in a Spanish-language admin chrome routinely edits English, French, and German content; a visitor reading the English public site can be handed one Japanese article without the site flipping into Japanese around them.

Search adds a fourth input without creating a fourth locale configuration: the language or scripts in the visitor's query text. The host still selects a result content locale for SearchQuery.locale; that scope does not have to match the interface locale or the query language, and it does not imply query translation or cross-lingual retrieval. See Search API.

Reference-app note

The example app keeps its public host interface to en/fr. Its Byline admin interface enables en, fr, es, de, it, zh-CN, and ko; its content locales are en, fr, es, de, zh-CN, and th-TH. The three sets remain independent even when some codes overlap.

Changing field localization

A field's localized flag controls whether its value is shared or varies by content locale. Changing that flag requires no database migration or separate content migration. Byline reads older versions using the current declaration and converts their stored values when the document is next saved in a single locale. Earlier versions remain unchanged in storage.

When a shared field becomes localized, its old shared value supplies any locale that has no value of its own. An existing value for a particular locale takes precedence. On the next single-locale save, Byline preserves the shared value for the document's source locale and every concrete locale represented in the previous version's stored fields, then merges the submitted locale's edits. It does not create translations for every locale configured in the application. For a document with no other localized values, this normally means its source locale plus the locale being saved.

These copied values still need editorial translation. For example, if a shared English summary becomes localized on a document that already has English and French titles, the French editor initially sees the English summary. Saving a French translation preserves the old summary for English. An all-locale read exposes the converted values as a locale map; projected reads can omit incomplete locales represented only in fields outside the projection.

When a localized field becomes shared, its source-locale value becomes the value seen in every locale. If a shared stored value already exists, that shared value wins. If neither exists, the field is absent; Byline does not choose another translation. The next single-locale save writes the shared value and drops the old translations from the new version. Historical versions retain their stored rows, although reads still interpret them using the current field declaration.

Public delivery continues to use the document's existing locale eligibility until the next save recomputes it. A public exact read of an ineligible locale withholds fields that are currently localized, including a newly localized field's old shared value. A field that is now shared remains visible using the rule above. These two changes—source-locale values replacing former translations and newly localized values being withheld—are intentional. See public delivery of advertised locales for eligibility and fallback rules.

Field filters and sorts follow the current declaration too. If a version already contains both shared and locale-specific rows for the same field, sorts choose the same winning value as reconstruction, but a filter can still match the losing value until a save converts the rows. Substring full-text queries can likewise return extra or missing matches before conversion. See Core Document Storage for the save process and Client SDK for whole-document writes and item identity requirements.

How this section is organised

  • The host i18n system — the public-site half: routable vs advertised locales, the non-sticky rule, and clean default-locale URLs.
  • Admin interface translations — what language the Byline admin UI renders in, owned by the @byline/i18n package.
  • Content locales — what language a document publishes in: resolution, fallback, and the editorial advertising control that decides which translations public reads deliver.
  • Administering content locales — switching a system's default content locale safely.

The two Byline-owned systems are deliberately independent: the admin shell language switcher never forces document content into the same language, and the public site's content locale never forces the admin chrome into the visitor's locale.

上一页Passkeys
下一页The host i18n system

本页内容

  • Three independent axes
  • Changing field localization
  • How this section is organised
Byline CMS

一次提交一点点,构建内容管理的未来。

项目

  • 文档
  • 路线图
  • 参与贡献
  • 版本发布

社区

  • GitHub 讨论区
  • 博客
  • 邮件订阅

法律声明

  • 隐私政策
  • 使用条款
  • Cookie

© 2026 Infonomic Company Limited 及贡献者。开源项目,由社区用 ❤️ 构建。