mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(editor): Convert autocompleteUIValues to a getter and streamline i18n HMR import (no-changelog) (#19560)
This commit is contained in:
@@ -109,8 +109,6 @@ watch(
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// Dev HMR for i18n is imported in main.ts before app mount
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'fake-indexeddb/auto';
|
||||
import { configure } from '@testing-library/vue';
|
||||
import 'core-js/proposals/set-methods-v2';
|
||||
import englishBaseText from '@n8n/i18n/locales/en.json';
|
||||
import { loadLanguage } from '@n8n/i18n';
|
||||
import { loadLanguage, type LocaleMessages } from '@n8n/i18n';
|
||||
import { APP_MODALS_ELEMENT_ID } from '@/constants';
|
||||
|
||||
// Avoid tests failing because of difference between local and GitHub actions timezone
|
||||
@@ -147,4 +147,4 @@ Object.defineProperty(HTMLElement.prototype, 'scrollTo', {
|
||||
value: vi.fn(),
|
||||
});
|
||||
|
||||
loadLanguage('en', englishBaseText);
|
||||
loadLanguage('en', englishBaseText as LocaleMessages);
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import { loadLanguage } from '@n8n/i18n';
|
||||
import type { LocaleMessages } from '@n8n/i18n/types';
|
||||
|
||||
export async function loadDefaultEn() {
|
||||
const mod = (await import('@n8n/i18n/locales/en.json')) as { default: LocaleMessages };
|
||||
loadLanguage('en', mod.default);
|
||||
}
|
||||
@@ -11,11 +11,13 @@ import '@n8n/design-system/css/index.scss';
|
||||
// import '@n8n/design-system/css/tailwind/index.css';
|
||||
|
||||
import './n8n-theme.scss';
|
||||
// Ensure i18n HMR owner is evaluated as early as possible in dev
|
||||
import '@/dev/i18nHmr';
|
||||
|
||||
import App from '@/App.vue';
|
||||
import router from './router';
|
||||
|
||||
import { i18nInstance, setLanguage } from '@n8n/i18n';
|
||||
import { i18nInstance } from '@n8n/i18n';
|
||||
|
||||
import { TelemetryPlugin } from './plugins/telemetry';
|
||||
import { GlobalComponentsPlugin } from './plugins/components';
|
||||
@@ -35,17 +37,6 @@ const app = createApp(App);
|
||||
|
||||
app.use(SentryPlugin);
|
||||
|
||||
// Initialize i18n
|
||||
if (import.meta.env.DEV) {
|
||||
// Import HMR owner early so messages are seeded before app mount
|
||||
await import('@/dev/i18nHmr');
|
||||
setLanguage('en');
|
||||
} else {
|
||||
// Production: load English messages explicitly via isolated module
|
||||
const { loadDefaultEn } = await import('@/i18n/loadDefaultEn');
|
||||
await loadDefaultEn();
|
||||
}
|
||||
|
||||
// Register module routes
|
||||
// We do this here so landing straight on a module page works
|
||||
registerModuleRoutes(router);
|
||||
|
||||
Reference in New Issue
Block a user