#!/usr/bin/env node
/**
* Generate localized beta flyer HTML from the German master via DeepL.
* Only visible body text and
are translated — CSS/HTML structure stay intact.
*
* Usage: node scripts/translate-flyer.mjs [--lang da,sv,nb]
*/
import { readFile, writeFile } from 'node:fs/promises'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { loadEnvKey, translateTexts } from './lib/deepl-translate.mjs'
const __dirname = dirname(fileURLToPath(import.meta.url))
const repoRoot = resolve(__dirname, '..')
const sourcePath = resolve(repoRoot, 'docs/marketing/beta-flyer.html')
const TARGETS = {
da: { code: 'DA', htmlLang: 'da', file: 'beta-flyer.da.html' },
sv: { code: 'SV', htmlLang: 'sv', file: 'beta-flyer.sv.html' },
nb: { code: 'NB', htmlLang: 'nb', file: 'beta-flyer.nb.html' }
}
const LANG_LIST_BLOCK = `Deutsch·English·Dansk·Svenska·Norsk`
/** Pull translatable strings from visible content only (never from