From 0f38aee374029213a47ef7c29bd164093fe63c85 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 15 Nov 2023 12:24:42 +0100 Subject: refactor(hooks): remove useSettings hook It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks. --- src/utils/helpers/server/i18n.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils/helpers/server') diff --git a/src/utils/helpers/server/i18n.ts b/src/utils/helpers/server/i18n.ts index dbbc4e5..8abd92e 100644 --- a/src/utils/helpers/server/i18n.ts +++ b/src/utils/helpers/server/i18n.ts @@ -1,10 +1,10 @@ import { readFile } from 'fs/promises'; import path from 'path'; -import { settings } from '../../config'; +import { CONFIG } from '../../config'; -export type Messages = { [key: string]: string }; +export type Messages = Record; -export const defaultLocale = settings.locales.defaultLocale; +export const { defaultLocale } = CONFIG.locales; /** * Load the translation for the provided locale. -- cgit v1.2.3