Move the catalogue note out of the catalogue
An English _note key sat in gospel.json in all eleven locales, so every Arabic reader downloaded an English paragraph about how the file is organised. It also fooled a gate: because it was text present in ar and absent from en, it satisfied a probe asking "does this bundle contain Arabic translations?" for a bundle with every Arabic character stripped out. A value no reader is meant to see is a value no check should be able to count. The reasoning it carried is real and is kept — which pools were searched, why a mistranslated caveat there would read as authoritative, why Open Bible Stories is not Scripture — moved to a README beside the catalogues along with the rule that nothing in those files is a comment. Adding that README turned check:i18n-parity red, which is the second half of this commit: it enumerated locales with existsSync, true for a file as well as a directory, so the README read as a locale missing all 1,685 keys. Documentation belongs next to what it documents; the filter was wrong. Locales are directories now. 2.7 KB out of every bundle, and gospel.prose.english — the one translated line that says the prose stays English — is untouched.
This commit is contained in:
parent
e25f2b9269
commit
bba33e783d
13 changed files with 28 additions and 12 deletions
|
|
@ -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'))
|
||||
|
||||
|
|
|
|||
24
library/i18n/locales/README.md
Normal file
24
library/i18n/locales/README.md
Normal file
|
|
@ -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.
|
||||
|
|
@ -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": "الملاحظات التوضيحية أدناه باللغة الإنجليزية."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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": "नीचे दी गई व्याख्यात्मक टिप्पणियाँ अंग्रेज़ी में हैं।"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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ă."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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": "Пояснительные примечания ниже — на английском языке."
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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": "以下说明性文字为英文。"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue