diff --git a/internal/check-i18n-parity.mjs b/internal/check-i18n-parity.mjs index 5ad14d33e..68d526324 100644 --- a/internal/check-i18n-parity.mjs +++ b/internal/check-i18n-parity.mjs @@ -42,7 +42,10 @@ const read = (loc, area) => { try { return flat(JSON.parse(readFileSync(p, 'utf8'))) } catch { return undefined } } -const locales = readdirSync(ROOT).filter((d) => existsSync(join(ROOT, d))) +// A locale is a DIRECTORY. The old existsSync() test was true for anything readdir returned, +// including a file, so adding a README beside the folders made it read as a locale missing all +// 1,685 keys. Documentation belongs next to the thing it documents; the filter is what was wrong. +const locales = readdirSync(ROOT, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name) if (!locales.includes('en')) { console.error('I18N-PARITY: FAIL — no English catalog to compare against'); process.exit(1) } const areas = readdirSync(join(ROOT, 'en')).filter((f) => f.endsWith('.json')) diff --git a/library/i18n/locales/README.md b/library/i18n/locales/README.md new file mode 100644 index 000000000..73f62be86 --- /dev/null +++ b/library/i18n/locales/README.md @@ -0,0 +1,24 @@ +# Locale catalogues + +One folder per locale, one JSON file per top-level area. `SUPPORTED_LOCALES` in +`library/i18n/index.js` is the list the runtime will actually try to resolve; the folders +here are what happens to exist on disk. A missing area file is fine — those namespaces +resolve through `fallbackLocale: 'en'`. + +**Nothing in these files is a comment.** Every string ships to every reader of that locale, +so notes about the catalogue belong here, not in a `_note` key. An English `_note` inside +`ar/gospel.json` was downloaded by every Arabic reader and — because it was text present in +`ar` and absent from `en` — it also satisfied a gate probing for "does this bundle contain +Arabic translations?", hiding the fact that every Arabic character had been stripped. A +value that no reader is meant to see is a value no check should be able to count. + +## gospel.json holds SHORT UI LABELS ONLY + +The explanatory prose on the gospel-resources surfaces stays in English on purpose and is +not in this area. It carries doctrinal and statistical precision — which pools were +searched, what "nothing found" does and does not claim, why Open Bible Stories is not +Scripture — and a mistranslated caveat there would read as authoritative. `gospel.prose.english` +is the one translated line that says so. + +When a human-reviewed translation of that prose exists, it gets its own area file and that +line comes out. diff --git a/library/i18n/locales/ar/gospel.json b/library/i18n/locales/ar/gospel.json index cd903b65c..36e5737f7 100644 --- a/library/i18n/locales/ar/gospel.json +++ b/library/i18n/locales/ar/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "الملاحظات التوضيحية أدناه باللغة الإنجليزية." }, diff --git a/library/i18n/locales/de/gospel.json b/library/i18n/locales/de/gospel.json index fb175fb95..9c2976ebd 100644 --- a/library/i18n/locales/de/gospel.json +++ b/library/i18n/locales/de/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Die erläuternden Hinweise unten sind auf Englisch." }, diff --git a/library/i18n/locales/en/gospel.json b/library/i18n/locales/en/gospel.json index e1e7d5658..c36a5f2be 100644 --- a/library/i18n/locales/en/gospel.json +++ b/library/i18n/locales/en/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file: it carries doctrinal and statistical precision — which pools were searched, what \"nothing found\" does and does not claim, why Open Bible Stories is not Scripture — and a mistranslated caveat there would read as authoritative. `prose.english` is the one translated line that says so. When a human-reviewed translation of the prose exists, it gets its own area file and that line comes out.", "prose": { "english": "Explanatory notes below are in English." }, diff --git a/library/i18n/locales/es/gospel.json b/library/i18n/locales/es/gospel.json index 6fc09f45a..1fb4ba9af 100644 --- a/library/i18n/locales/es/gospel.json +++ b/library/i18n/locales/es/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Las notas explicativas siguientes están en inglés." }, diff --git a/library/i18n/locales/fr/gospel.json b/library/i18n/locales/fr/gospel.json index 8219b25a5..3f4f79f6b 100644 --- a/library/i18n/locales/fr/gospel.json +++ b/library/i18n/locales/fr/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Les notes explicatives ci-dessous sont en anglais." }, diff --git a/library/i18n/locales/hi/gospel.json b/library/i18n/locales/hi/gospel.json index f2f614eeb..e454fb34a 100644 --- a/library/i18n/locales/hi/gospel.json +++ b/library/i18n/locales/hi/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "नीचे दी गई व्याख्यात्मक टिप्पणियाँ अंग्रेज़ी में हैं।" }, diff --git a/library/i18n/locales/it/gospel.json b/library/i18n/locales/it/gospel.json index 6531997bc..a918de5d4 100644 --- a/library/i18n/locales/it/gospel.json +++ b/library/i18n/locales/it/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Le note esplicative qui sotto sono in inglese." }, diff --git a/library/i18n/locales/pt/gospel.json b/library/i18n/locales/pt/gospel.json index 46cab7f16..9416a6f47 100644 --- a/library/i18n/locales/pt/gospel.json +++ b/library/i18n/locales/pt/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "As notas explicativas abaixo estão em inglês." }, diff --git a/library/i18n/locales/ro/gospel.json b/library/i18n/locales/ro/gospel.json index 33e883171..51ccd9aeb 100644 --- a/library/i18n/locales/ro/gospel.json +++ b/library/i18n/locales/ro/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Notele explicative de mai jos sunt în limba engleză." }, diff --git a/library/i18n/locales/ru/gospel.json b/library/i18n/locales/ru/gospel.json index df2789941..b79562c69 100644 --- a/library/i18n/locales/ru/gospel.json +++ b/library/i18n/locales/ru/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "Пояснительные примечания ниже — на английском языке." }, diff --git a/library/i18n/locales/zh/gospel.json b/library/i18n/locales/zh/gospel.json index 68a04bd46..30da46ddc 100644 --- a/library/i18n/locales/zh/gospel.json +++ b/library/i18n/locales/zh/gospel.json @@ -1,5 +1,4 @@ { - "_note": "SHORT UI LABELS ONLY for the gospel-resources bundle. The explanatory prose on those surfaces stays in English on purpose and is NOT in this file; prose.english is the one translated line that says so.", "prose": { "english": "以下说明性文字为英文。" },