diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-15 12:24:42 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-15 17:26:16 +0100 |
| commit | 0f38aee374029213a47ef7c29bd164093fe63c85 (patch) | |
| tree | 290cb6471fdfe81e4c42f4da4729247536b04ee7 /src/utils/helpers/server/i18n.ts | |
| parent | be4d907efb4e2fa658baa7c9b276ed282eb920db (diff) | |
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.
Diffstat (limited to 'src/utils/helpers/server/i18n.ts')
| -rw-r--r-- | src/utils/helpers/server/i18n.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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<string, string>; -export const defaultLocale = settings.locales.defaultLocale; +export const { defaultLocale } = CONFIG.locales; /** * Load the translation for the provided locale. |
