Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 2 min read

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:

  1. Content parity: How to ensure every RU article has an EN counterpart with matching metadata?
  2. Quality control: How to catch broken links, invalid JSON-LD, and duplicate routes before deployment?
  3. 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

  1. Automate early: Validation scripts save hours of manual checking
  2. TypeScript is your friend: Compile-time guards catch errors before production
  3. 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.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.