Skip to content

Commit 8fc5765

Browse files
authored
hot fix: fixed i18n and i18n types (#7394)
1 parent 6cd9e13 commit 8fc5765

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/site/i18n.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const loadLocaleDictionary = async (locale: string) => {
1313
}
1414

1515
if (availableLocaleCodes.includes(locale)) {
16-
// Other languages don't really require HMR as they will never be development languages
17-
// so we can load them dynamically
18-
const messages = importLocale(locale);
16+
// Other languages don't really require HMR as they
17+
// will never be development languages so we can load them dynamically
18+
const messages = await importLocale(locale);
1919

2020
// Use default messages as fallback
2121
return deepMerge(defaultMessages, messages);

packages/i18n/lib/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import localeConfig from '@node-core/website-i18n/config.json' with { type: 'jso
66
* Imports a locale when exists from the locales directory
77
*
88
* @param {string} locale The locale code to import
9-
* @returns {Record<string, any>} The imported locale
9+
* @returns {Promise<Record<string, any>>} The imported locale
1010
*/
1111
export const importLocale = async locale => {
1212
return import(`../locales/${locale}.json`).then(f => f.default);

0 commit comments

Comments
 (0)