Building a Validation Pipeline for a Multilingual FinTech Blog
The Problem When building a multilingual blog (RU/EN) for algorithmic trading content, we faced three core challenges: Content parity: How to ensure every RU article has an EN counterpart with matching metadata? Qu
The Problem
When building a multilingual blog (RU/EN) for algorithmic trading content, we faced three core challenges:
- Content parity: How to ensure every RU article has an EN counterpart with matching metadata?
- Quality control: How to catch broken links, invalid JSON-LD, and duplicate routes before deployment?
- UX consistency: How to maintain scroll position when switching languages?
The Solution
We built a validation pipeline with strict TypeScript guards for content parity.
1. Automated Validation Script
We created npm run verify that runs 5 checks:
#!/bin/bash
# 1. Build project
npm run build
# 2. Check JSON-LD (no raw stringify)
grep -r "JSON.stringify" dist/ && exit 1
# 3. Check duplicate paths (404)
# Custom script to find duplicate routes
# 4. Check NUL bytes in Markdown
grep -r $'\0' src/content/ && exit 1
# 5. Check internal links
# Custom script to validate all internal links
This script is integrated into pre-commit hooks, blocking any commit that fails validation.
2. TypeScript Locale Parity Guard
In i18n/ui.ts, we added a compile-time check:
const ui = {
ru: {
'nav.home': 'ΠΠ»Π°Π²Π½Π°Ρ',
'nav.saga': 'Π‘Π°Π³Π°',
// ... 87 keys
},
en: {
'nav.home': 'Home',
'nav.saga': 'Saga',
// ... 90 keys
},
} as const;
// Parity guard: forces compiler to check all ru keys exist in en
type LocaleParity = Record<keyof (typeof ui)['ru'], string>;
const _enParity: LocaleParity = ui.en;
If someone adds a new key to ru but forgets en, TypeScript throws a compilation error.
3. Scroll Restoration
We implemented scroll position preservation using sessionStorage:
sessionStorage.setItem('scrollY', String(window.scrollY));
requestAnimationFrame(() => {
const saved = sessionStorage.getItem('scrollY');
if (saved) window.scrollTo(0, parseInt(saved));
});
Results
After a week of development:
- 50+ technical issues resolved
- Full RU/EN parity enforced at compile time
- 7 pre-commit checks blocking bad code
- 14 A11y issues fixed
- 6 dead files removed (~189 KB)
Key Takeaways
- Automate early: Validation scripts save hours of manual checking
- TypeScript is your friend: Compile-time guards catch errors before production
- Building in public attracts collaborators: Transparency builds trust
Resources
FΓLAG is a multilingual blog about algorithmic trading, cryptocurrency, and automation. We share our engineering decisions and learnings as we build.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.