From a1396fd2c79ddc693976d9554ca05f9cd60ac2fb Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Thu, 1 Oct 2026 12:54:14 +0000 Subject: [PATCH] Desktop-only notice: "English" is the locale the sentence is translated into, so a caller passing an empty locale no longer gets the English name in an Arabic sentence --- internal/check-mobile-gating.mjs | 3 +++ library/components/LargerScreenNotice.vue | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/check-mobile-gating.mjs b/internal/check-mobile-gating.mjs index 4a20fd740..4bcaee359 100644 --- a/internal/check-mobile-gating.mjs +++ b/internal/check-mobile-gating.mjs @@ -77,6 +77,8 @@ export function checkGating({ metas, leaves, spaSrc, spaLocales, libLocales, loa if (!/useScreenGate\(config\)/.test(loaderSrc)) errs.push('ProfileLoader no longer applies the phone rule (useScreenGate)') // (f2) the map's English name only in an English sentence: in any other locale the notice uses the unnamed one if (!/props\.label && english\.value/.test(noticeSrc || '') || !/messages\.desktopOnlyNoticeUnnamed/.test(noticeSrc || '')) errs.push('LargerScreenNotice puts the English map name into a non-English sentence (it must use desktopOnlyNoticeUnnamed outside English)') + // (f3) and "English" is the locale the words come out in (tStatic's order), not an empty prop read as English + if (!/props\.locale \|\| getRuntimeLocale\(\) \|\| detectLocale\(\)/.test(noticeSrc || '')) errs.push('LargerScreenNotice decides "English" from the locale prop alone: a caller passing \'\' gets an Arabic sentence with the English name') if (!/hasAttribute\('data-doxa-gallery'\)/.test(gateSrc)) errs.push('the phone rule no longer stays quiet inside the Gallery (data-doxa-gallery)') // (g) every flagged profile's element actually applies the rule for (const m of metas) { @@ -177,6 +179,7 @@ if (process.argv.includes('--self-test')) { ['(e) the desktop-only sentence stops naming the map', { ...real, libLocales: { ...real.libLocales, zh: { ...real.libLocales.zh, desktopOnlyNotice: '仅支持桌面端' } } }, 1], ['(e) the unnamed sentence names the map', { ...real, libLocales: { ...real.libLocales, ar: { ...real.libLocales.ar, desktopOnlyNoticeUnnamed: '{label} يعمل على الحاسوب فقط' } } }, 1], ['(f2) the English name goes back into every locale', { ...real, noticeSrc: real.noticeSrc.replace('props.label && english.value', 'props.label') }, 1], + ['(f3) an empty-locale caller counts as English (the old logic)', { ...real, noticeSrc: real.noticeSrc.replace('props.locale || getRuntimeLocale() || detectLocale() || \'en\'', 'props.locale || \'en\'') }, 1], ['(f) ProfileLoader stops blocking', { ...real, loaderSrc: real.loaderSrc.replace('v-else-if="blockedOnThisScreen"', 'v-else-if="false"') }, 1], ['(g) a flagged composite drops its own gate', { ...real, mounts: { ...real.mounts, 'dashboard-plus-grid/dashboard-plus-grid': { viaLoader: false, ownGate: false } } }, 1], ] diff --git a/library/components/LargerScreenNotice.vue b/library/components/LargerScreenNotice.vue index 4ebf68140..6d0f46028 100644 --- a/library/components/LargerScreenNotice.vue +++ b/library/components/LargerScreenNotice.vue @@ -25,7 +25,7 @@