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';(orimport enHero from './locales/en/home/hero'ini18n.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 Name | Role | Status | Import Usage |
|---|---|---|---|
hero.ts | Production Head | Active | import ... from './hero' |
hero_v2.ts | Archive (Previous) | Deprecated | Reference Only / Rollback |
hero_v1.ts | Archive (MVP) | Deprecated | Reference 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 defaultstructure 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.tsbecausei18n.tsimports 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.tsrepresents the MVP thinking, whilehero.tsrepresents 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:
- Rename:
hero.ts->hero_v2.ts. - Create: New
hero.ts. - 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?
- Zero Refactoring: We avoid having to hunt down every component and change
import hero from './hero_v2'toimport hero from './hero_v3'. - Safe Rollbacks: If the new content has a logic error, we can simply delete
hero.tsand renamehero_v2.tsback tohero.tsto restore the site instantly. - 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.