feat: add i18n dictionaries and service data
Locale-aware EN/FR string dictionaries and the two-service data model (CVE Watch with per-locale URLs, Convert with a single URL).
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export type Locale = 'en' | 'fr';
|
||||
|
||||
export const locales: Locale[] = ['en', 'fr'];
|
||||
|
||||
export function otherLocale(locale: Locale): Locale {
|
||||
return locale === 'en' ? 'fr' : 'en';
|
||||
}
|
||||
|
||||
export function swapLocalePath(pathname: string, from: Locale, to: Locale): string {
|
||||
return pathname.replace(`/${from}/`, `/${to}/`);
|
||||
}
|
||||
Reference in New Issue
Block a user