diff --git a/apps/site/i18n.tsx b/apps/site/i18n.tsx index b11472b589d77..81209f2b5ed71 100644 --- a/apps/site/i18n.tsx +++ b/apps/site/i18n.tsx @@ -13,9 +13,9 @@ const loadLocaleDictionary = async (locale: string) => { } if (availableLocaleCodes.includes(locale)) { - // Other languages don't really require HMR as they will never be development languages - // so we can load them dynamically - const messages = importLocale(locale); + // Other languages don't really require HMR as they + // will never be development languages so we can load them dynamically + const messages = await importLocale(locale); // Use default messages as fallback return deepMerge(defaultMessages, messages); diff --git a/packages/i18n/lib/index.mjs b/packages/i18n/lib/index.mjs index a1baf03f5db71..33a2602445a12 100644 --- a/packages/i18n/lib/index.mjs +++ b/packages/i18n/lib/index.mjs @@ -6,7 +6,7 @@ import localeConfig from '@node-core/website-i18n/config.json' with { type: 'jso * Imports a locale when exists from the locales directory * * @param {string} locale The locale code to import - * @returns {Record} The imported locale + * @returns {Promise>} The imported locale */ export const importLocale = async locale => { return import(`../locales/${locale}.json`).then(f => f.default);