@ -13,7 +13,6 @@
* (builder-style, always visible), a slide-in drawer, a popover, or
* (builder-style, always visible), a slide-in drawer, a popover, or
* none. The same `< WordsInspector > ` body is reused across all of them.
* none. The same `< WordsInspector > ` body is reused across all of them.
*/
*/
import { onMount } from 'svelte';
import { ActiveEidos } from '$uix/eidos';
import { ActiveEidos } from '$uix/eidos';
import * as Words from '$soma/components/words';
import * as Words from '$soma/components/words';
import { Button } from '$uix/eidos/components/button';
import { Button } from '$uix/eidos/components/button';
@ -48,15 +47,14 @@
// client pass emit different markup and hydration bails. Defer the
// client pass emit different markup and hydration bails. Defer the
// editor to the client; SSR + first paint render the empty frame.
// editor to the client; SSR + first paint render the empty frame.
let mounted = $state(false);
let mounted = $state(false);
onMount(() => {
// Client-only activation + one-time langs registration. Reads nothing
// reactive, so this $effect runs exactly once on mount (the Svelte 5 way,
// no lifecycle import). Register the inspector's localized strings into the
// active langs schema — without this every label resolves to the inline
// English fallback regardless of locale. `extend` deep-merges so app-level
// overrides at the same path applied AFTER mount still win.
$effect(() => {
mounted = true;
mounted = true;
// Register the inspector's localized strings into the active
// langs schema. Without this every label resolves to the inline
// English fallback regardless of the active locale — declaring
// idlangrefs alone never localizes, the bundle must be extended.
// `extend` deep-merges so app-level overrides at the same path
// applied AFTER mount still win (the engine warns on leaf
// overwrites in DEV).
eidos.langs.extend('components.words.inspector', WORDS_INSPECTOR_BUNDLE);
eidos.langs.extend('components.words.inspector', WORDS_INSPECTOR_BUNDLE);
eidos.langs.extend('components.words.menu', WORDS_MENU_BUNDLE);
eidos.langs.extend('components.words.menu', WORDS_MENU_BUNDLE);
});
});