diff --git a/library/components/search/FilterDropdown.vue b/library/components/search/FilterDropdown.vue index 5478048a0..355c0cff8 100644 --- a/library/components/search/FilterDropdown.vue +++ b/library/components/search/FilterDropdown.vue @@ -38,7 +38,15 @@ const props = defineProps({ // two visible strings — the clear button and the empty state — were English literals, and one of // them ('No options found') was ALREADY catalogued in eleven locales elsewhere in this repo, so // the translation existed and this component was ignoring it. -const { t } = useI18n() +// +// ★ i18n IS OPTIONAL HERE, NOT REQUIRED. useI18n() THROWS ("Need to install with `app.use` +// function") when the host element never installed vue-i18n — and people-groups-grid deliberately +// doesn't (its labels arrive through its `t` prop). The unguarded call blanked the grid standalone, +// in the studio and inside every composite that nests it (measured 2026-09-25: 2 DOM nodes, page +// error on mount). Use the host's translations when it has them, English otherwise. +const FALLBACK = { 'buttons.clearSelection': 'Clear selection', 'buttons.noOptions': 'No options found' } +let t = (key) => FALLBACK[key] || key +try { t = useI18n().t } catch (_) { /* no i18n on this host: keep the English fallback */ } const emit = defineEmits(['filter-change', 'filter-clear'])