Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 85x 81x | /**
* @module Infrastructure/Rss/Hreflang
* @category Intelligence Operations / Supporting Infrastructure
* @name Hreflang code mapping
*
* @description
* Pure helper that maps file-suffix language codes (the suffix used in
* filenames like `…_no.html`) to BCP-47 hreflang codes (Norwegian uses
* `nb`). All other codes pass through unchanged. Identical contract to
* `sitemap-xml/hreflang.ts` — the duplication keeps each bounded
* context self-contained.
*
* Round-6 split: extracted from `scripts/generate-rss.ts`.
*
* @author Hack23 AB (Infrastructure Team)
* @license Apache-2.0
*/
/**
* Map a file-suffix language code to its BCP-47 hreflang code.
* Norwegian files use the suffix `no` but hreflang should be `nb` (Bokmål).
*/
export function hreflangCode(lang: string): string {
if (lang === 'no') return 'nb';
return lang;
}
|