Localize Bless India plugin UI in all 11 locales + RTL
The plugin's own page chrome (title, intro, buttons, stats, notes) was English in every locale, and in RTL shells its full stops jumped to the start. Add the page strings to blessIndiaPosters.json x11, look them up from the reader's locale (profile-config from the shells; ?lang / <html lang> on the standalone leaf), set dir=rtl for ar/he/fa/ur, and format counts via the locale. Verified: ar leaf draws dir=rtl with the Arabic title; en draws dir=ltr.
This commit is contained in:
parent
2e0800c5ad
commit
6cd0a8b73c
12 changed files with 129 additions and 29 deletions
|
|
@ -2,5 +2,13 @@
|
|||
"title": "ملصقات باركوا الهند",
|
||||
"rangeBadge60x96": "شارات النطاق · 60×96 (5×8 قدم)",
|
||||
"count": "{count} مجموعة شعبية",
|
||||
"desktopOnly": "سطح المكتب فقط حاليًا — لم يَثبُت بعد أن هذا الملصق الكبير يُطبع بأمان على الهاتف."
|
||||
"desktopOnly": "سطح المكتب فقط حاليًا — لم يَثبُت بعد أن هذا الملصق الكبير يُطبع بأمان على الهاتف.",
|
||||
"experimental": "تجريبي",
|
||||
"intro": "كل مجموعة شعبية في الهند على ورقة واحدة قابلة للطباعة، تُولَّد مباشرةً وتُعرَض كأوراقها القابلة للطباعة مع شرائط اللصق — بالطريقة نفسها التي يعرض بها عرض المقاسات التنسيقات الكبيرة.",
|
||||
"print": "اطبع هذا الملصق",
|
||||
"attempt": "شارات النطاق · 60×96 (5×8 قدم) · 3 أوراق",
|
||||
"stat": "{groups} مجموعة · {badges} شارة نطاق · 0 تداخل",
|
||||
"generating": "جارٍ توليد الملصق من البيانات الحية…",
|
||||
"error": "تعذَّر توليد الملصق: {msg}",
|
||||
"photos": "فقط {real} من {total} مجموعة في الهند لديها صورة في البيانات؛ المستند المطبوع يحملها، بينما الصورة المسطحة لا تستطيع. هذا التصميم المرقَّم يطبع الأسماء بدون صور لتكون كل مجموعة متساوية وواضحة."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "„Segne Indien“-Poster",
|
||||
"rangeBadge60x96": "Nummern-Marken · 60×96 (5×8 Fuß)",
|
||||
"count": "{count} Volksgruppen",
|
||||
"desktopOnly": "Vorerst nur am Desktop — es ist noch nicht erwiesen, dass dieses große Poster sicher auf einem Telefon druckt."
|
||||
"desktopOnly": "Vorerst nur am Desktop — es ist noch nicht erwiesen, dass dieses große Poster sicher auf einem Telefon druckt.",
|
||||
"experimental": "experimentell",
|
||||
"intro": "Jede Volksgruppe Indiens auf einem druckbaren Bogen, live erzeugt und als ihre druckbaren Bögen mit Klebestreifen gezeigt — so wie die Größen-Ansicht von Poster Design die großen Formate zeigt.",
|
||||
"print": "Dieses Poster drucken",
|
||||
"attempt": "Nummern-Marken · 60×96 (5×8 Fuß) · 3 Bögen",
|
||||
"stat": "{groups} Gruppen · {badges} Nummern-Marken · 0 Überlappungen",
|
||||
"generating": "Poster wird aus den Live-Daten erzeugt…",
|
||||
"error": "Poster konnte nicht erzeugt werden: {msg}",
|
||||
"photos": "Nur {real} von {total} indischen Gruppen haben ein Foto in den Daten; ein gedrucktes Dokument trägt sie, ein flaches Bild nicht. Dieses nummerierte Design druckt Namen ohne Fotos, damit jede Gruppe gleich und lesbar ist."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Bless India Posters",
|
||||
"rangeBadge60x96": "Range badges · 60×96 (5×8 ft)",
|
||||
"count": "{count} people groups",
|
||||
"desktopOnly": "Desktop only for now — this large poster isn’t yet proven to print safely on a phone."
|
||||
"desktopOnly": "Desktop only for now — this large poster isn’t yet proven to print safely on a phone.",
|
||||
"experimental": "experimental",
|
||||
"intro": "Every India people group on one printable sheet, generated live and shown as its printable sheets with glue strips — the way Poster Design's Sizes view shows the big formats.",
|
||||
"print": "Print this poster",
|
||||
"attempt": "Range badges · 60×96 (5×8 ft) · 3 sheets",
|
||||
"stat": "{groups} groups · {badges} range badges · 0 overlaps",
|
||||
"generating": "Generating the poster from the live data…",
|
||||
"error": "Couldn't generate the poster: {msg}",
|
||||
"photos": "Only {real} of {total} India groups have a photo in the data; a printed document carries them, a flat image can't. This numbered design prints names without photos so every group is equal and legible."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Pósteres «Bendice a la India»",
|
||||
"rangeBadge60x96": "Insignias numeradas · 60×96 (5×8 pies)",
|
||||
"count": "{count} grupos de población",
|
||||
"desktopOnly": "Solo escritorio por ahora: aún no se ha comprobado que este póster grande se imprima de forma segura en un teléfono."
|
||||
"desktopOnly": "Solo escritorio por ahora: aún no se ha comprobado que este póster grande se imprima de forma segura en un teléfono.",
|
||||
"experimental": "experimental",
|
||||
"intro": "Cada grupo de población de la India en una sola hoja imprimible, generada en vivo y mostrada como sus hojas imprimibles con las tiras de pegado, igual que la vista Tamaños de Poster Design muestra los formatos grandes.",
|
||||
"print": "Imprimir este póster",
|
||||
"attempt": "Insignias numeradas · 60×96 (5×8 pies) · 3 hojas",
|
||||
"stat": "{groups} grupos · {badges} insignias numeradas · 0 solapamientos",
|
||||
"generating": "Generando el póster a partir de los datos en vivo…",
|
||||
"error": "No se pudo generar el póster: {msg}",
|
||||
"photos": "Solo {real} de {total} grupos de la India tienen foto en los datos; un documento impreso las lleva, una imagen plana no. Este diseño numerado imprime los nombres sin fotos para que cada grupo sea igual y legible."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Affiches « Bénis l’Inde »",
|
||||
"rangeBadge60x96": "Badges de numéros · 60×96 (5×8 pi)",
|
||||
"count": "{count} groupes de population",
|
||||
"desktopOnly": "Ordinateur uniquement pour l’instant — il n’est pas encore prouvé que cette grande affiche s’imprime correctement sur un téléphone."
|
||||
"desktopOnly": "Ordinateur uniquement pour l’instant — il n’est pas encore prouvé que cette grande affiche s’imprime correctement sur un téléphone.",
|
||||
"experimental": "expérimental",
|
||||
"intro": "Chaque groupe de population de l'Inde sur une seule feuille imprimable, générée en direct et montrée comme ses feuilles imprimables avec les bandes de collage — comme la vue Tailles de Poster Design montre les grands formats.",
|
||||
"print": "Imprimer cette affiche",
|
||||
"attempt": "Badges de numéros · 60×96 (5×8 pi) · 3 feuilles",
|
||||
"stat": "{groups} groupes · {badges} badges de numéros · 0 chevauchement",
|
||||
"generating": "Génération de l'affiche à partir des données en direct…",
|
||||
"error": "Impossible de générer l'affiche : {msg}",
|
||||
"photos": "Seulement {real} des {total} groupes de l'Inde ont une photo dans les données ; un document imprimé les porte, une image plate non. Ce modèle numéroté imprime les noms sans photos pour que chaque groupe soit égal et lisible."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "भारत को आशीष दें — पोस्टर",
|
||||
"rangeBadge60x96": "क्रमांकित बैज · 60×96 (5×8 फुट)",
|
||||
"count": "{count} लोग समूह",
|
||||
"desktopOnly": "अभी केवल डेस्कटॉप — यह बड़ा पोस्टर अभी फ़ोन पर सुरक्षित रूप से प्रिंट होना सिद्ध नहीं हुआ है।"
|
||||
"desktopOnly": "अभी केवल डेस्कटॉप — यह बड़ा पोस्टर अभी फ़ोन पर सुरक्षित रूप से प्रिंट होना सिद्ध नहीं हुआ है।",
|
||||
"experimental": "प्रायोगिक",
|
||||
"intro": "भारत का हर लोग-समूह एक ही प्रिंट-योग्य शीट पर, लाइव डेटा से बनाया गया और गोंद-पट्टियों के साथ अपनी प्रिंट-योग्य शीटों के रूप में दिखाया गया — जैसे Poster Design का Sizes व्यू बड़े फ़ॉर्मैट दिखाता है।",
|
||||
"print": "यह पोस्टर प्रिंट करें",
|
||||
"attempt": "रेंज बैज · 60×96 (5×8 फुट) · 3 शीट",
|
||||
"stat": "{groups} समूह · {badges} रेंज बैज · 0 ओवरलैप",
|
||||
"generating": "लाइव डेटा से पोस्टर बनाया जा रहा है…",
|
||||
"error": "पोस्टर नहीं बन सका: {msg}",
|
||||
"photos": "डेटा में {total} में से केवल {real} भारतीय समूहों के पास फ़ोटो है; मुद्रित दस्तावेज़ उन्हें ले जाता है, सपाट छवि नहीं। यह क्रमांकित डिज़ाइन बिना फ़ोटो के नाम छापता है ताकि हर समूह समान और सुपाठ्य हो।"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Poster «Benedici l’India»",
|
||||
"rangeBadge60x96": "Badge numerati · 60×96 (5×8 ft)",
|
||||
"count": "{count} gruppi di popolazione",
|
||||
"desktopOnly": "Solo desktop per ora — non è ancora dimostrato che questo grande poster si stampi in sicurezza su un telefono."
|
||||
"desktopOnly": "Solo desktop per ora — non è ancora dimostrato che questo grande poster si stampi in sicurezza su un telefono.",
|
||||
"experimental": "sperimentale",
|
||||
"intro": "Ogni gruppo di popolazione dell'India su un unico foglio stampabile, generato dal vivo e mostrato come i suoi fogli stampabili con le strisce di colla — come la vista Dimensioni di Poster Design mostra i grandi formati.",
|
||||
"print": "Stampa questo poster",
|
||||
"attempt": "Badge numerati · 60×96 (5×8 ft) · 3 fogli",
|
||||
"stat": "{groups} gruppi · {badges} badge numerati · 0 sovrapposizioni",
|
||||
"generating": "Generazione del poster dai dati dal vivo…",
|
||||
"error": "Impossibile generare il poster: {msg}",
|
||||
"photos": "Solo {real} di {total} gruppi dell'India hanno una foto nei dati; un documento stampato le porta, un'immagine piatta no. Questo design numerato stampa i nomi senza foto così ogni gruppo è uguale e leggibile."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Pôsteres «Abençoe a Índia»",
|
||||
"rangeBadge60x96": "Emblemas numerados · 60×96 (5×8 pés)",
|
||||
"count": "{count} grupos populacionais",
|
||||
"desktopOnly": "Apenas no computador por enquanto — ainda não se comprovou que este pôster grande imprime com segurança num telemóvel."
|
||||
"desktopOnly": "Apenas no computador por enquanto — ainda não se comprovou que este pôster grande imprime com segurança num telemóvel.",
|
||||
"experimental": "experimental",
|
||||
"intro": "Cada grupo populacional da Índia numa única folha imprimível, gerada ao vivo e mostrada como as suas folhas imprimíveis com as tiras de cola — como a vista Tamanhos do Poster Design mostra os formatos grandes.",
|
||||
"print": "Imprimir este pôster",
|
||||
"attempt": "Emblemas numerados · 60×96 (5×8 pés) · 3 folhas",
|
||||
"stat": "{groups} grupos · {badges} emblemas numerados · 0 sobreposições",
|
||||
"generating": "A gerar o pôster a partir dos dados ao vivo…",
|
||||
"error": "Não foi possível gerar o pôster: {msg}",
|
||||
"photos": "Apenas {real} de {total} grupos da Índia têm foto nos dados; um documento impresso leva-as, uma imagem plana não. Este design numerado imprime os nomes sem fotos para que cada grupo seja igual e legível."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Postere „Binecuvântează India”",
|
||||
"rangeBadge60x96": "Insigne numerotate · 60×96 (5×8 ft)",
|
||||
"count": "{count} grupuri de popoare",
|
||||
"desktopOnly": "Doar pe desktop deocamdată — nu s-a dovedit încă că acest poster mare se tipărește în siguranță pe un telefon."
|
||||
"desktopOnly": "Doar pe desktop deocamdată — nu s-a dovedit încă că acest poster mare se tipărește în siguranță pe un telefon.",
|
||||
"experimental": "experimental",
|
||||
"intro": "Fiecare grup de popoare din India pe o singură coală imprimabilă, generată live și afișată ca foile sale imprimabile cu benzile de lipici — așa cum vizualizarea Dimensiuni din Poster Design arată formatele mari.",
|
||||
"print": "Imprimă acest poster",
|
||||
"attempt": "Insigne numerotate · 60×96 (5×8 ft) · 3 foi",
|
||||
"stat": "{groups} grupuri · {badges} insigne numerotate · 0 suprapuneri",
|
||||
"generating": "Se generează posterul din datele live…",
|
||||
"error": "Nu s-a putut genera posterul: {msg}",
|
||||
"photos": "Doar {real} din {total} grupuri din India au o fotografie în date; un document tipărit le poartă, o imagine plană nu. Acest design numerotat tipărește numele fără fotografii, astfel încât fiecare grup să fie egal și lizibil."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "Плакаты «Благослови Индию»",
|
||||
"rangeBadge60x96": "Номерные значки · 60×96 (5×8 футов)",
|
||||
"count": "{count} народностей",
|
||||
"desktopOnly": "Пока только на компьютере — ещё не доказано, что этот большой плакат безопасно печатается на телефоне."
|
||||
"desktopOnly": "Пока только на компьютере — ещё не доказано, что этот большой плакат безопасно печатается на телефоне.",
|
||||
"experimental": "экспериментально",
|
||||
"intro": "Каждая народность Индии на одном печатном листе, создаётся вживую и показывается как её печатные листы с полосами склейки — так же, как представление «Размеры» в Poster Design показывает большие форматы.",
|
||||
"print": "Напечатать этот плакат",
|
||||
"attempt": "Номерные значки · 60×96 (5×8 футов) · 3 листа",
|
||||
"stat": "{groups} народностей · {badges} номерных значков · 0 наложений",
|
||||
"generating": "Плакат создаётся по «живым» данным…",
|
||||
"error": "Не удалось создать плакат: {msg}",
|
||||
"photos": "Только у {real} из {total} народностей Индии есть фото в данных; печатный документ несёт их, плоское изображение — нет. Этот нумерованный дизайн печатает имена без фото, чтобы каждая народность была равной и читаемой."
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,13 @@
|
|||
"title": "祝福印度海报",
|
||||
"rangeBadge60x96": "编号标记 · 60×96(5×8 英尺)",
|
||||
"count": "{count} 个族群",
|
||||
"desktopOnly": "目前仅限桌面——尚未证明这张大海报能在手机上安全打印。"
|
||||
"desktopOnly": "目前仅限桌面——尚未证明这张大海报能在手机上安全打印。",
|
||||
"experimental": "实验性",
|
||||
"intro": "印度的每个族群都在一张可打印的大纸上,由实时数据生成,并像其可打印的分页那样带着拼接胶条显示——就像 Poster Design 的尺寸视图展示大幅面那样。",
|
||||
"print": "打印此海报",
|
||||
"attempt": "编号标记 · 60×96(5×8 英尺)· 3 张",
|
||||
"stat": "{groups} 个族群 · {badges} 个编号标记 · 0 重叠",
|
||||
"generating": "正在根据实时数据生成海报……",
|
||||
"error": "无法生成海报:{msg}",
|
||||
"photos": "数据中 {total} 个印度族群中只有 {real} 个有照片;打印文档能承载它们,而平面图像不能。此编号设计打印名称而不带照片,使每个族群平等且清晰易读。"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,32 +16,29 @@
|
|||
onto letter would be shrunk).
|
||||
-->
|
||||
<template>
|
||||
<div class="bip-root">
|
||||
<div class="bip-root" :dir="dir">
|
||||
<header class="bip-top">
|
||||
<div>
|
||||
<h1>Bless India Posters <span class="bip-exp">experimental</span></h1>
|
||||
<p class="bip-sub">
|
||||
Every India people group on one sheet, generated live and shown as its printable sheets with
|
||||
the glue strips — the way Poster Design's Sizes view shows the big formats.
|
||||
</p>
|
||||
<h1>{{ t('title') }} <span class="bip-exp">{{ t('experimental') }}</span></h1>
|
||||
<p class="bip-sub">{{ t('intro') }}</p>
|
||||
</div>
|
||||
<div class="bip-actions">
|
||||
<button v-if="!isPhone" class="bip-btn" :disabled="!posterHtml || busy" @click="printPoster">
|
||||
Print this poster
|
||||
{{ t('print') }}
|
||||
</button>
|
||||
<span v-else class="bip-phone">{{ phoneLimitMsg }}</span>
|
||||
<span v-else class="bip-phone">{{ t('desktopOnly') }}</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="bip-attempt">
|
||||
<div class="bip-meta">
|
||||
<span class="bip-name">Range badges · 60×96 (5×8 ft) · 3 sheets</span>
|
||||
<span class="bip-stat" v-if="stats">{{ stats.placed }} groups · {{ stats.rangeBadges }} range badges · 0 overlaps</span>
|
||||
<span class="bip-name">{{ t('attempt') }}</span>
|
||||
<span class="bip-stat" v-if="stats">{{ t('stat', { groups: n(stats.placed), badges: n(stats.rangeBadges) }) }}</span>
|
||||
</div>
|
||||
|
||||
<div class="bip-stage">
|
||||
<div v-if="busy" class="bip-note">Generating the poster from the live data…</div>
|
||||
<div v-else-if="error" class="bip-note bip-err">Couldn't generate the poster: {{ error }}</div>
|
||||
<div v-if="busy" class="bip-note">{{ t('generating') }}</div>
|
||||
<div v-else-if="error" class="bip-note bip-err">{{ t('error', { msg: error }) }}</div>
|
||||
<PanelSheets
|
||||
v-else-if="svgUrl"
|
||||
v-bind="SHEETS"
|
||||
|
|
@ -52,11 +49,7 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<p class="bip-photos">
|
||||
Photos: only {{ realPhotos }} of {{ stats ? stats.placed : 855 }} India groups have one in the data; a
|
||||
printed <b>document</b> carries those photos, a flat image can't (the photo hosts send no CORS). This
|
||||
numbered design prints names without photos so every group is equal and legible.
|
||||
</p>
|
||||
<p class="bip-photos">{{ t('photos', { real: n(realPhotos), total: n(stats ? stats.placed : 855) }) }}</p>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -92,11 +85,30 @@ const parsedConfig = (() => {
|
|||
try { return JSON.parse(c) } catch { return {} }
|
||||
})()
|
||||
|
||||
// Lightweight i18n for the plugin's OWN page chrome, so Arabic readers read Arabic (not English with
|
||||
// misplaced RTL punctuation). Reads the locale the shells pass (profileConfig.locale/lang), loads the
|
||||
// blessIndiaPosters.json for that language (English fallback), and sets dir for RTL scripts. Counts go
|
||||
// through the locale's number format. The POSTER's blessing header/footer is the separate footer work.
|
||||
const LOCALE_MSGS = import.meta.glob('../../library/i18n/locales/*/blessIndiaPosters.json', { eager: true })
|
||||
const msgPath = (l) => `../../library/i18n/locales/${l}/blessIndiaPosters.json`
|
||||
const urlLang = (() => { try { return new URLSearchParams(location.search).get('lang') || '' } catch { return '' } })()
|
||||
const docLang = (() => { try { return document.documentElement.lang || '' } catch { return '' } })()
|
||||
const lang = String(parsedConfig.locale || parsedConfig.lang || urlLang || docLang || 'en').split('-')[0].toLowerCase()
|
||||
const EN = (LOCALE_MSGS[msgPath('en')] || {}).default || {}
|
||||
const MSGS = (LOCALE_MSGS[msgPath(lang)] || {}).default || EN
|
||||
const dir = ['ar', 'he', 'fa', 'ur', 'ps', 'sd', 'yi'].includes(lang) ? 'rtl' : 'ltr'
|
||||
const nf = (() => { try { return new Intl.NumberFormat(lang) } catch { return new Intl.NumberFormat('en') } })()
|
||||
const n = (x) => nf.format(Number(x) || 0)
|
||||
const t = (key, vars) => {
|
||||
let s = (MSGS[key] != null ? MSGS[key] : EN[key] != null ? EN[key] : key)
|
||||
if (vars) for (const [k, v] of Object.entries(vars)) s = String(s).split(`{${k}}`).join(v)
|
||||
return s
|
||||
}
|
||||
|
||||
const SHEETS = POSTER_LADDER['60x96'].sheets // { sheetW:60, sheetH:36, count:3, direction, joinIn:6 }
|
||||
const seriesDef = (seriesJson && seriesJson.country) || {}
|
||||
|
||||
const isPhone = typeof window !== 'undefined' && window.matchMedia && window.matchMedia('(max-width: 767px)').matches
|
||||
const phoneLimitMsg = 'Desktop only for now — this large poster isn’t yet proven to print safely on a phone.'
|
||||
|
||||
const busy = ref(true)
|
||||
const error = ref('')
|
||||
|
|
|
|||
Loading…
Reference in a new issue