Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | SOFTWARE & RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project : agentilab-web8 * File : lib/i18n/config.ts9 * Module : I18n10 * Repository : https://git.spboucher.ai/agentilab-web11 * Project Website : Not specified12 * Created : 2026-12-0513 * Last Modified : 2026-12-0514 *15 * Author : Simon-Pierre Boucher16 * Position : Professor of Finance17 * Institution : Université du Québec en Outaouais (UQO)18 * Organization : SP Boucher19 * Website : https://spboucher.ai20 * Git : https://git.spboucher.ai21 *22 * Preferred Contact: contact@spboucher.ai23 * Development : dev@spboucher.ai24 * Support : support@spboucher.ai25 * Security/Admin : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License : Proprietary34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243export const locales = ['fr', 'en'] as const;44export type Locale = (typeof locales)[number];45export const defaultLocale: Locale = 'fr';4647/** Balises de langue BCP 47 : attribut `lang`, hreflang et formatage Intl. */48export const languageTag: Record<Locale, string> = { fr: 'fr-CA', en: 'en-CA' };49export const openGraphLocale: Record<Locale, string> = { fr: 'fr_CA', en: 'en_CA' };5051export type Localized = Record<Locale, string>;5253export function formatDate(iso: string, locale: Locale): string {54 // Les dates du catalogue sont des jours civils (AAAA-MM-JJ) : formatées en UTC55 // pour ne jamais glisser d'un jour selon le fuseau du serveur.56 return new Intl.DateTimeFormat(languageTag[locale], { dateStyle: 'long', timeZone: 'UTC' }).format(57 new Date(`${iso}T00:00:00Z`),58 );59}60