Locale-aware EN/FR string dictionaries and the two-service data model (CVE Watch with per-locale URLs, Convert with a single URL).
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import type { Locale } from './locale';
|
|
|
|
export interface Service {
|
|
id: string;
|
|
url: string | Record<Locale, string>;
|
|
name: Record<Locale, string>;
|
|
tag: Record<Locale, string>;
|
|
description: Record<Locale, string>;
|
|
}
|
|
|
|
export const services: Service[] = [
|
|
{
|
|
id: 'cve',
|
|
url: {
|
|
en: 'https://cve-en.ombrora.com',
|
|
fr: 'https://cve-fr.ombrora.com',
|
|
},
|
|
name: { en: 'CVE Watch', fr: 'Veille CVE' },
|
|
tag: { en: 'Security blog', fr: 'Blog sécurité' },
|
|
description: {
|
|
en: 'Daily-tracked CVE disclosures, explained.',
|
|
fr: 'Les CVE publiées, suivies et expliquées au quotidien.',
|
|
},
|
|
},
|
|
{
|
|
id: 'convert',
|
|
url: 'https://convert.ombrora.com',
|
|
name: { en: 'Convert', fr: 'Convert' },
|
|
tag: { en: 'File converter', fr: 'Convertisseur de fichiers' },
|
|
description: {
|
|
en: 'Convert documents, audio, images, video, and archives.',
|
|
fr: 'Convertissez documents, audio, images, vidéos et archives.',
|
|
},
|
|
},
|
|
];
|
|
|
|
export function resolveServiceUrl(service: Service, locale: Locale): string {
|
|
return typeof service.url === 'string' ? service.url : service.url[locale];
|
|
}
|