Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot fix: fixed i18n and i18n types #7394

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading