Skip to content

Commit

Permalink
hot fix: fixed i18n and i18n types (#7394)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Jan 8, 2025
1 parent 6cd9e13 commit 8fc5765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/site/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>} The imported locale
* @returns {Promise<Record<string, any>>} The imported locale
*/
export const importLocale = async locale => {
return import(`../locales/${locale}.json`).then(f => f.default);
Expand Down

0 comments on commit 8fc5765

Please sign in to comment.