Docs
Protocol Verified

I18n Versioning Protocol

The 'Active Head' strategy for managing content evolution without breaking imports.

PRID: 1611
VERIFIED
3 min read

SOP: I18n Content Versioning Protocol (The "Active Head" Strategy)

Version: 1.1 Status: ACTIVE Context: Managing content evolution without breaking code dependencies.


1. The Core Philosophy: "Code Stability, Content Fluidity"

In the Mouth Ship™ architecture, content (especially the Landing Page and Manifesto) evolves rapidly, but the consuming Components (Hero, ManifestoPage) expect a stable import path.

The Golden Rule:

The file without a version suffix is ALWAYS the Production (Latest) Version.

  • Code Import: import hero from './hero'; (or import enHero from './locales/en/home/hero' in i18n.ts)
  • Result: The code never needs to be updated just because the content text changed. The file system handles the versioning, not the import statement.

2. Naming Convention (The Matrix)

File NameRoleStatusImport Usage
hero.tsProduction HeadActiveimport ... from './hero'
hero_v2.tsArchive (Previous)DeprecatedReference Only / Rollback
hero_v1.tsArchive (MVP)DeprecatedReference Only / Rollback

3. Execution Workflow (The Slide-Back Method)

When you need to update a content file (e.g., upgrading matrix.ts from v2 to v3), follow this "Slide-Back" procedure:

Step 1: Freeze Current State (Archive)

Rename the current active file to its version number.

  • Action: Rename hero.ts -> hero_v2.ts (assuming it was version 2).
  • Note: Do not modify the content inside yet. Just rename the file.

Step 2: Create New Head (Update)

Create a new file with the base name.

  • Action: Create hero.ts.
  • Content: Paste the new (v3) content here.
  • Check: Ensure the export default structure matches the previous version to prevent TypeScript errors.

Step 3: Verification (Hot Swap)

  • Action: Save both files.
  • Result: The application (via Vite HMR) will automatically pick up the new hero.ts because i18n.ts imports the base filename.
  • Audit: Check the UI. The content should reflect the new version.

Step 4: Historical Preservation

  • Action: Commit both files to Git.
  • Value: This preserves the evolutionary history of the product messaging. hero_v1.ts represents the MVP thinking, while hero.ts represents the current truth.

4. Example Scenario: Updating the Hero Section

Current State:

  • src/locales/zh/home/hero.ts (Contains "One Mouth, Global SaaS")
  • src/locales/zh/home/hero_v1.ts (Contains "Old Title")

Objective:

  • Update Hero title to "The Mouth Ship Protocol" (Version 3).

Operation:

  1. Rename: hero.ts -> hero_v2.ts.
  2. Create: New hero.ts.
  3. Write: Add "The Mouth Ship Protocol" content to the new hero.ts.

Final State:

  • hero.ts (Active v3)
  • hero_v2.ts (Archived v2)
  • hero_v1.ts (Archived v1)

5. Why We Do This?

  1. Zero Refactoring: We avoid having to hunt down every component and change import hero from './hero_v2' to import hero from './hero_v3'.
  2. Safe Rollbacks: If the new content has a logic error, we can simply delete hero.ts and rename hero_v2.ts back to hero.ts to restore the site instantly.
  3. Academic Integrity: As an "Open Source Autoethnography," the history of the thought process is as valuable as the current result. We keep the old files as artifacts.

Authority Distribution

Share this technical artifact