Merge branch 'translation-selection'
This commit is contained in:
commit
4becab01d6
6 changed files with 352 additions and 226 deletions
|
|
@ -61,6 +61,7 @@ const meta = `{
|
|||
<dialog data-scripture=""
|
||||
class="p-0 rounded-sm w-full lg:max-w-lg xl:max-w-lg 2xl:max-w-lg m-auto flex-col flex hidden scripture">
|
||||
<div tabindex="-1" autofocus class="p-4">
|
||||
<div>
|
||||
<button data-close="">
|
||||
<span class="align-middle mr-1">close</span>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle inline" viewBox="0 0 16 16">
|
||||
|
|
@ -68,12 +69,18 @@ const meta = `{
|
|||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<select class="translation text-sm mt-0 p-2 text-gray-400 bg-gray-700 border-1 dark:border-gray-800 rounded-sm w-full">
|
||||
<option value="BSB">Berean Standard Bible (BSB)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="spinner">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-book-fill hidden" viewBox="0 0 16 16">
|
||||
<path d="M8 1.783C7.015.936 5.587.81 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.809 8.985.936 8 1.783"/>
|
||||
</svg>
|
||||
</div>
|
||||
<article class="mt-6">
|
||||
<article class="mt-2">
|
||||
</article>
|
||||
</div>
|
||||
</dialog>
|
||||
|
|
|
|||
|
|
@ -149,14 +149,14 @@ dialog.scripture {
|
|||
@apply mt-0 pl-14;
|
||||
}
|
||||
button[data-close] {
|
||||
@apply absolute top-0 right-0 pr-2 pb-2 pt-2 text-sm text-gray-500 cursor-pointer hover:text-red-900;
|
||||
@apply absolute top-0 right-0 pr-2 pb-4 pt-2 text-sm text-gray-500 cursor-pointer hover:text-red-900;
|
||||
@apply dark:text-gray-400 dark:hover:text-red-500;
|
||||
span {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
h1 {
|
||||
@apply font-bold mb-2 text-2xl;
|
||||
@apply font-bold mb-2 mt-0 text-2xl;
|
||||
@apply dark:text-neutral-300;
|
||||
}
|
||||
nav {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,15 +1,10 @@
|
|||
import { aliases, meta } from './meta.js';
|
||||
|
||||
import { aliases, defaulttx, meta, translations } from './meta.js';
|
||||
import { hasLocalStorage } from './utils.js';
|
||||
|
||||
export const modal = (el) => {
|
||||
|
||||
};
|
||||
|
||||
const translations = {
|
||||
'BSB': 'Berean Standard Bible',
|
||||
'MSB': 'Majority Standard Bible',
|
||||
};
|
||||
|
||||
function parseRef(ref) {
|
||||
ref = ref.replace(/%3[Aa]/, ':').replace(/\+/, ' ');
|
||||
const m = ref.match(/((\d+(\+|\s))?[a-zA-Z]+)(\+|\s)?([0-9]+)?\:?([0-9]+(-?[0-9]+)?)?/);
|
||||
|
|
@ -75,125 +70,216 @@ function parseRef(ref) {
|
|||
return refdata;
|
||||
}
|
||||
|
||||
function render(dialog, response, refs) {
|
||||
const content = response?.chapter?.content;
|
||||
let inSpan = false;
|
||||
class RenderScripture {
|
||||
translation = 'BSB';
|
||||
dialog = null;
|
||||
sel = null;
|
||||
ls = false;
|
||||
ref = {};
|
||||
|
||||
if (dialog === null || dialog === undefined) {
|
||||
return;
|
||||
}
|
||||
constructor(dialog) {
|
||||
this.dialog = dialog;
|
||||
|
||||
const section = document.createElement('section');
|
||||
const article = dialog?.querySelector('article');
|
||||
let para = document.createElement('p');
|
||||
|
||||
const heading = document.createElement('h1');
|
||||
heading.insertAdjacentText('beforeend',
|
||||
`${refs.fullTitle()}`);
|
||||
article.insertAdjacentElement('beforeend', heading);
|
||||
|
||||
for (const c of content) {
|
||||
if (c.type === 'heading') {
|
||||
continue;
|
||||
if (hasLocalStorage()) {
|
||||
this.ls = true;
|
||||
this.translation = localStorage.getItem('__translation') || 'BSB';
|
||||
}
|
||||
|
||||
let verse = document.createElement('span');
|
||||
const elems = document.querySelectorAll('a[data-scripture]');
|
||||
elems.forEach((e) => {
|
||||
e.addEventListener('click', (evt) => {
|
||||
this.anchorClick(evt)
|
||||
});
|
||||
});
|
||||
const sel = this.dialog[0]?.querySelector('select.translation');
|
||||
sel?.addEventListener('change', (evt) => {
|
||||
this.txnOnChange(evt)
|
||||
});
|
||||
this.sel = sel;
|
||||
|
||||
switch (c.type) {
|
||||
case 'line_break':
|
||||
if (inSpan) {
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
para = document.createElement('p');
|
||||
this.dialog[0]?.addEventListener('click', (evt) => {
|
||||
if (evt.target === this.dialog[0]) {
|
||||
this.closeDialog()
|
||||
}
|
||||
break;
|
||||
case 'verse':
|
||||
if (!('number' in c)) {
|
||||
});
|
||||
this.dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
||||
evt.preventDefault();
|
||||
this.closeDialog();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
anchorClick(evt) {
|
||||
const scripture = evt.target.attributes.getNamedItem('data-scripture');
|
||||
const refs = parseRef(scripture.value);
|
||||
const tx = refs.meta?.tx || 'BSB';
|
||||
this.ref = refs;
|
||||
evt.preventDefault();
|
||||
this.dialog[0]?.showModal();
|
||||
this.dialog[0]?.setAttribute('data-scripture', scripture.value);
|
||||
this.dialog[0]?.classList.remove("hidden");
|
||||
this.dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
this.buildTranslationList(this.sel);
|
||||
this.readScripture(refs);
|
||||
}
|
||||
|
||||
buildTranslationList(sel) {
|
||||
sel?.replaceChildren();
|
||||
for (const tx in translations) {
|
||||
const testament = meta[this.ref.book].ts;
|
||||
if (translations[tx][2].indexOf(testament) == -1) {
|
||||
continue;
|
||||
}
|
||||
if (!('verses' in refs) || (c.number >= refs.verses.start && c.number <= refs.verses.end)) {
|
||||
inSpan = true;
|
||||
} else {
|
||||
inSpan = false;
|
||||
const opt = document.createElement('option');
|
||||
opt.setAttribute('value', tx);
|
||||
opt.insertAdjacentText('beforeend', translations[tx][0]);
|
||||
if (tx == this.translation) {
|
||||
opt.setAttribute('selected', 'selected');
|
||||
}
|
||||
if (inSpan) {
|
||||
verse.insertAdjacentText('beforeend', c.number);
|
||||
verse.classList.add('verse');
|
||||
para.insertAdjacentElement('beforeend', verse);
|
||||
verse = document.createElement('span');
|
||||
for (const v of c.content) {
|
||||
if (typeof(v) === 'string') {
|
||||
para.insertAdjacentText('beforeend', v+' ');
|
||||
continue
|
||||
}
|
||||
if ('lineBreak' in v) {
|
||||
if (para.innerHTML.length != 0 || para.innerText.length != 0) {
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
para = document.createElement('p');
|
||||
sel?.insertAdjacentElement('beforeend', opt);
|
||||
}
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.dialog[0]?.close();
|
||||
this.dialog[0]?.classList.add('hidden');
|
||||
this.dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
}
|
||||
|
||||
txnOnChange(evt) {
|
||||
const tx = evt.target.selectedOptions[0].value;
|
||||
this.translation = tx;
|
||||
if (this.ls) {
|
||||
localStorage.setItem('__translation', tx);
|
||||
}
|
||||
const refs = parseRef(this.dialog[0]?.getAttribute('data-scripture'));
|
||||
this.dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
this.dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
this.readScripture(refs);
|
||||
}
|
||||
|
||||
readScripture(refs) {
|
||||
// Current translation.
|
||||
let tx = this.translation;
|
||||
// Previous translation.
|
||||
const px = this.translation;
|
||||
|
||||
const book = refs.book;
|
||||
const chapter = refs.chapter;
|
||||
const testament = meta[book].ts;
|
||||
|
||||
// If the current translation doesn't contain the testament, switch to
|
||||
// the default translation that does.
|
||||
if (translations[tx][2].indexOf(testament) == -1) {
|
||||
tx = defaulttx[testament];
|
||||
this.translation = tx;
|
||||
}
|
||||
|
||||
const uri = `https://bible.helloao.org/api/${tx}/${book.toUpperCase()}/${chapter}.json`;
|
||||
fetch(uri)
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
console.error('query failed');
|
||||
console.log(response);
|
||||
return;
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then((response) => {
|
||||
this.render(response, refs);
|
||||
this.dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.add('hidden');
|
||||
// Switch translation back if it's forced to a different
|
||||
// translation from book availability.
|
||||
if (this.translation != px) {
|
||||
this.translation = px;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render(response, refs) {
|
||||
const content = response?.chapter?.content;
|
||||
let inSpan = false;
|
||||
|
||||
if (this.dialog === null || this.dialog === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
const section = document.createElement('section');
|
||||
const article = this.dialog[0]?.querySelector('article');
|
||||
let para = document.createElement('p');
|
||||
|
||||
const heading = document.createElement('h1');
|
||||
heading.insertAdjacentText('beforeend',
|
||||
`${refs.fullTitle()}`);
|
||||
article.insertAdjacentElement('beforeend', heading);
|
||||
|
||||
for (const c of content) {
|
||||
if (c.type === 'heading') {
|
||||
continue;
|
||||
}
|
||||
|
||||
let verse = document.createElement('span');
|
||||
|
||||
switch (c.type) {
|
||||
case 'line_break':
|
||||
if (inSpan) {
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
para = document.createElement('p');
|
||||
}
|
||||
break;
|
||||
case 'verse':
|
||||
if (!('number' in c)) {
|
||||
continue;
|
||||
}
|
||||
if (!('verses' in refs) || (c.number >= refs.verses.start && c.number <= refs.verses.end)) {
|
||||
inSpan = true;
|
||||
} else {
|
||||
inSpan = false;
|
||||
}
|
||||
if (inSpan) {
|
||||
verse.insertAdjacentText('beforeend', c.number);
|
||||
verse.classList.add('verse');
|
||||
para.insertAdjacentElement('beforeend', verse);
|
||||
verse = document.createElement('span');
|
||||
for (const v of c.content) {
|
||||
if (typeof(v) === 'string') {
|
||||
para.insertAdjacentText('beforeend', v+' ');
|
||||
continue
|
||||
}
|
||||
//para.insertAdjacentElement('beforeend', document.createElement('br'));
|
||||
//para = document.createElement('p');
|
||||
}
|
||||
if ('text' in v) {
|
||||
para.insertAdjacentText('beforeend', v.text);
|
||||
if ('poem' in v) {
|
||||
para.classList.add('poem-'+v.poem);
|
||||
if ('lineBreak' in v) {
|
||||
if (para.innerHTML.length != 0 || para.innerText.length != 0) {
|
||||
section.insertAdjacentElement('beforeend',
|
||||
para);
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
para = document.createElement('p');
|
||||
}
|
||||
}
|
||||
if ('text' in v) {
|
||||
para.insertAdjacentText('beforeend', v.text);
|
||||
if ('poem' in v) {
|
||||
para.classList.add('poem-'+v.poem);
|
||||
if (para.innerHTML.length != 0 || para.innerText.length != 0) {
|
||||
section.insertAdjacentElement('beforeend',
|
||||
para);
|
||||
}
|
||||
para = document.createElement('p');
|
||||
}
|
||||
para = document.createElement('p');
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.error('unhandled type:', c.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.error('unhandled type:', c.type);
|
||||
}
|
||||
//console.log(c);
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
article.insertAdjacentElement('beforeend', section);
|
||||
}
|
||||
section.insertAdjacentElement('beforeend', para);
|
||||
article.insertAdjacentElement('beforeend', section);
|
||||
}
|
||||
|
||||
export const bindModals = () => {
|
||||
const elems = document.querySelectorAll('a[data-scripture]');
|
||||
const dialog = document.querySelectorAll('dialog[data-scripture]');
|
||||
elems.forEach((e) => {
|
||||
e.addEventListener('click', (evt) => {
|
||||
const scripture = e.attributes.getNamedItem('data-scripture');
|
||||
const refs = parseRef(scripture.value);
|
||||
const tx = refs.meta?.tx || 'BSB';
|
||||
evt.preventDefault();
|
||||
const uri = `https://bible.helloao.org/api/${tx}/${refs.book.toUpperCase()}/${refs.chapter}.json`;
|
||||
dialog[0]?.showModal();
|
||||
dialog[0]?.setAttribute('data-scripture', scripture);
|
||||
dialog[0]?.classList.remove("hidden");
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.remove('hidden');
|
||||
|
||||
fetch(uri)
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
})
|
||||
.then((response) => {
|
||||
render(dialog[0], response, refs);
|
||||
dialog[0]?.querySelector('.spinner svg')
|
||||
.classList.add('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
dialog[0]?.addEventListener('click', (evt) => {
|
||||
if (evt.target === dialog[0]) {
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
}
|
||||
});
|
||||
dialog[0]?.querySelector('button[data-close]')?.addEventListener('click', (evt) => {
|
||||
evt.preventDefault();
|
||||
dialog[0]?.close();
|
||||
dialog[0]?.classList.add('hidden');
|
||||
dialog[0]?.querySelector('article')?.replaceChildren();
|
||||
});
|
||||
const renderer = new RenderScripture(dialog);
|
||||
};
|
||||
16
src/utils/utils.js
Normal file
16
src/utils/utils.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
export const hasLocalStorage = () => {
|
||||
try {
|
||||
var ls = localStorage;
|
||||
var key = "__test";
|
||||
ls.setItem(key, key);
|
||||
ls.removeItem(key);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return (
|
||||
e instanceof DOMException &&
|
||||
e.name === "QuotaExceededError" &&
|
||||
localStorage &&
|
||||
localStorage.length !== 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -475,126 +475,139 @@ aliases = {i.lower(): k for k, v in alias_map.items() for i in v}
|
|||
for k in alias_map.keys():
|
||||
aliases[k] = k
|
||||
|
||||
use_translations = [
|
||||
"AAB", # Accessible Ancients Bible AAB
|
||||
"BSB", # Berean Standard Bible BSB
|
||||
"ENGWEBP", # World English Bible WEB
|
||||
"GHT", # Garth's Hyper-literal Translation GHT
|
||||
"eng_abt", # American Standard Version Byzantine Text ASVBT
|
||||
"eng_asv", # American Standard Version (1901) ASV
|
||||
#"eng_bbe", # Bible in Basic English BBE
|
||||
"eng_boy", # Updated Brenton English Septuagint UBES
|
||||
"eng_bre", # Brenton Septuagint Translation BST
|
||||
"eng_emtv", # English Majority Text Version EMTV
|
||||
#"eng_f35", # The New Testament with Commentary TNTC
|
||||
"eng_fbv", # Free Bible Version FBV
|
||||
"eng_glw", # God's Living Word GLW
|
||||
#"eng_gnv", # Geneva Bible 1599 GNV
|
||||
"eng_kja", # King James Version + Apocrypha KJVA
|
||||
"eng_kjv", # King James (Authorized) Version KJAV
|
||||
"eng_lsv", # Literal Standard Version LSV
|
||||
"eng_lxx", # LXX2012: Septuagint in American English 2012 LXXSA
|
||||
"eng_msb", # Majority Standard Bible MSB
|
||||
"eng_net", # NET Bible NETB
|
||||
"eng_pev", # Plain English Version PEV
|
||||
"eng_rv5", # Revised Version with Apocrypha (1895) RVA
|
||||
"eng_t4t", # Translation for Translators T4T
|
||||
"eng_tce", # Text-Critical English New Testament TCENT
|
||||
#"eng_tnt", # Tyndale New Testament TNT
|
||||
"eng_ulb", # Unlocked Literal Bible ULB
|
||||
"eng_w88", # Wycliffe Bible W88
|
||||
"eng_wbs", # Noah Webster Bible NWB
|
||||
"eng_web", # World English Bible Classic WEBC
|
||||
"eng_webu", # World English Bible Updated WEBU
|
||||
"eng_wyc2017", # Wycliffe's Bible with Modern Spelling WBMS
|
||||
"eng_wyc2018", # Wycliffe's Bible with Modern Spelling (Enhanced) WBMSE
|
||||
"eng_ylt", # Young's Literal Translation YLT
|
||||
]
|
||||
shorthand_defaults = {
|
||||
"OT": "BSB",
|
||||
"NT": "BSB",
|
||||
"APO": "eng_kja",
|
||||
"LXX": "eng_lxx",
|
||||
}
|
||||
|
||||
use_translations = {
|
||||
"BSB": ["Berean Standard Bible", "BSB", ["OT", "NT"]],
|
||||
"eng_msb": ["Majority Standard Bible", "MSB", ["NT"]],
|
||||
"eng_lsv": ["Literal Standard Version", "LSV", ["OT", "NT"]],
|
||||
"eng_net": ["NET Bible", "NETB", ["OT", "NT"]],
|
||||
"eng_asv": ["American Standard Version (1901)", "ASV", ["OT", "NT"]],
|
||||
"eng_abt": ["American Standard Version Byzantine Text", "ASVBT", ["OT", "NT"]],
|
||||
"eng_kjv": ["King James (Authorized) Version", "KJAV", ["OT", "NT"]],
|
||||
"eng_kja": ["King James Version + Apocrypha", "KJVA", ["OT", "NT", "APO"]],
|
||||
"eng_rv5": ["Revised Version with Apocrypha (1895)", "RVA", ["OT", "NT", "APO"]],
|
||||
"eng_ylt": ["Young's Literal Translation", "YLT", ["OT", "NT"]],
|
||||
"AAB": ["Accessible Ancients Bible", "AAB", ["OT", "NT"]],
|
||||
"eng_fbv": ["Free Bible Version", "FBV", ["OT", "NT"]],
|
||||
"eng_wbs": ["Noah Webster Bible", "NWB", ["OT", "NT"]],
|
||||
"eng_ulb": ["Unlocked Literal Bible", "ULB", ["OT", "NT"]],
|
||||
"ENGWEBP": ["World English Bible", "WEB", ["OT", "NT"]],
|
||||
"eng_web": ["World English Bible Classic", "WEBC", ["OT", "NT"]],
|
||||
"eng_webu": ["World English Bible Updated", "WEBU", ["OT", "NT"]],
|
||||
"eng_lxx": ["Septuagint in American English (2012)", "LXXSA", ["OT", "APO"]],
|
||||
"eng_bre": ["Brenton Septuagint Translation", "BST", ["OT", "APO"]],
|
||||
"eng_boy": ["Updated Brenton English Septuagint", "UBES", ["OT", "APO"]],
|
||||
# Broken: Parser?
|
||||
#"GHT": ["Garth's Hyper-literal Translation", "GHT"],
|
||||
#"eng_bbe": ["Bible in Basic English BBE"],
|
||||
# Broken: Parser?
|
||||
#"eng_emtv": ["English Majority Text Version", "EMTV"],
|
||||
#"eng_f35": ["The New Testament with Commentary TNTC"],
|
||||
# Broken: Parser?
|
||||
#"eng_glw": ["God's Living Word", "GLW"],
|
||||
#"eng_gnv": ["Geneva Bible 1599 GNV"],
|
||||
# Broken: Reads like heresy.
|
||||
#"eng_pev": ["Plain English Version", "PEV"],
|
||||
# Broken: Empty content.
|
||||
#"eng_t4t": ["Translation for Translators", "T4T"],
|
||||
# Broken: Parser?
|
||||
#"eng_tce": ["Text-Critical English New Testament", "TCENT"],
|
||||
#"eng_tnt": ["Tyndale New Testament TNT"],
|
||||
#"eng_w88": ["Wycliffe Bible", "W88"],
|
||||
#"eng_wyc2017": ["Wycliffe's Bible with Modern Spelling", "WBMS"],
|
||||
#"eng_wyc2018": ["Wycliffe's Bible with Modern Spelling(Enhanced)", "WBMSE"],
|
||||
}
|
||||
|
||||
bookmeta = {
|
||||
'gen': {'tx': 'BSB'},
|
||||
'exo': {'tx': 'BSB'},
|
||||
'lev': {'tx': 'BSB'},
|
||||
'num': {'tx': 'BSB'},
|
||||
'deu': {'tx': 'BSB'},
|
||||
'jos': {'tx': 'BSB'},
|
||||
'jdg': {'tx': 'BSB'},
|
||||
'rut': {'tx': 'BSB'},
|
||||
'1sa': {'tx': 'BSB'},
|
||||
'2sa': {'tx': 'BSB'},
|
||||
'1ki': {'tx': 'BSB'},
|
||||
'2ki': {'tx': 'BSB'},
|
||||
'1ch': {'tx': 'BSB'},
|
||||
'2ch': {'tx': 'BSB'},
|
||||
'ezr': {'tx': 'BSB'},
|
||||
'neh': {'tx': 'BSB'},
|
||||
'est': {'tx': 'BSB'},
|
||||
'job': {'tx': 'BSB'},
|
||||
'psa': {'tx': 'BSB'},
|
||||
'pro': {'tx': 'BSB'},
|
||||
'ecc': {'tx': 'BSB'},
|
||||
'sng': {'tx': 'BSB'},
|
||||
'isa': {'tx': 'BSB'},
|
||||
'jer': {'tx': 'BSB'},
|
||||
'lam': {'tx': 'BSB'},
|
||||
'ezk': {'tx': 'BSB'},
|
||||
'dan': {'tx': 'BSB'},
|
||||
'hos': {'tx': 'BSB'},
|
||||
'jol': {'tx': 'BSB'},
|
||||
'amo': {'tx': 'BSB'},
|
||||
'oba': {'tx': 'BSB'},
|
||||
'jon': {'tx': 'BSB'},
|
||||
'mic': {'tx': 'BSB'},
|
||||
'nam': {'tx': 'BSB'},
|
||||
'hab': {'tx': 'BSB'},
|
||||
'zep': {'tx': 'BSB'},
|
||||
'hag': {'tx': 'BSB'},
|
||||
'zec': {'tx': 'BSB'},
|
||||
'mal': {'tx': 'BSB'},
|
||||
'mat': {'tx': 'BSB'},
|
||||
'mrk': {'tx': 'BSB'},
|
||||
'luk': {'tx': 'BSB'},
|
||||
'jhn': {'tx': 'BSB'},
|
||||
'act': {'tx': 'BSB'},
|
||||
'rom': {'tx': 'BSB'},
|
||||
'1co': {'tx': 'BSB'},
|
||||
'2co': {'tx': 'BSB'},
|
||||
'gal': {'tx': 'BSB'},
|
||||
'eph': {'tx': 'BSB'},
|
||||
'php': {'tx': 'BSB'},
|
||||
'col': {'tx': 'BSB'},
|
||||
'1th': {'tx': 'BSB'},
|
||||
'2th': {'tx': 'BSB'},
|
||||
'1ti': {'tx': 'BSB'},
|
||||
'2ti': {'tx': 'BSB'},
|
||||
'tit': {'tx': 'BSB'},
|
||||
'phm': {'tx': 'BSB'},
|
||||
'heb': {'tx': 'BSB'},
|
||||
'jas': {'tx': 'BSB'},
|
||||
'1pe': {'tx': 'BSB'},
|
||||
'2pe': {'tx': 'BSB'},
|
||||
'1jn': {'tx': 'BSB'},
|
||||
'2jn': {'tx': 'BSB'},
|
||||
'3jn': {'tx': 'BSB'},
|
||||
'jud': {'tx': 'BSB'},
|
||||
'rev': {'tx': 'BSB'},
|
||||
'gen': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'exo': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'lev': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'num': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'deu': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'jos': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'jdg': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'rut': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'1sa': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'2sa': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'1ki': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'2ki': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'1ch': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'2ch': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'ezr': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'neh': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'est': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'job': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'psa': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'pro': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'ecc': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'sng': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'isa': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'jer': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'lam': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'ezk': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'dan': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'hos': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'jol': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'amo': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'oba': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'jon': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'mic': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'nam': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'hab': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'zep': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'hag': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'zec': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'mal': {'tx': 'BSB', 'ts': 'OT'},
|
||||
'mat': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'mrk': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'luk': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'jhn': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'act': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'rom': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'1co': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'2co': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'gal': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'eph': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'php': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'col': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'1th': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'2th': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'1ti': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'2ti': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'tit': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'phm': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'heb': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'jas': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'1pe': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'2pe': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'1jn': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'2jn': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'3jn': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'jud': {'tx': 'BSB', 'ts': 'NT'},
|
||||
'rev': {'tx': 'BSB', 'ts': 'NT'},
|
||||
# Apocrypha.
|
||||
'tob': {'tx': 'eng_lxx'},
|
||||
'jdt': {'tx': 'eng_lxx'},
|
||||
'wis': {'tx': 'eng_lxx'},
|
||||
'sir': {'tx': 'eng_lxx'},
|
||||
'bar': {'tx': 'eng_lxx'},
|
||||
'bel': {'tx': 'eng_lxx'},
|
||||
'sus': {'tx': 'eng_lxx'},
|
||||
'1ma': {'tx': 'eng_lxx'},
|
||||
'2ma': {'tx': 'eng_lxx'},
|
||||
'3ma': {'tx': 'eng_lxx'},
|
||||
'4ma': {'tx': 'eng_lxx'},
|
||||
'1es': {'tx': 'eng_lxx'},
|
||||
'tob': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'jdt': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'wis': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'sir': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'bar': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'bel': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'sus': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'1ma': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'2ma': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'3ma': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'4ma': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'1es': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
# Not present in all LXX.
|
||||
'lje': {'tx': 'eng_lxx'},
|
||||
's3y': {'tx': 'eng_lxx'},
|
||||
'man': {'tx': 'eng_lxx'},
|
||||
'lje': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
's3y': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
'man': {'tx': 'eng_lxx', 'ts': 'APO'},
|
||||
}
|
||||
for k, v in bookmeta.items():
|
||||
if k in alias_map:
|
||||
|
|
@ -623,7 +636,8 @@ def write_meta(file="meta.js"):
|
|||
fp.write(b"// Translation meta\n\n")
|
||||
fp.write(f"export const aliases = {json.dumps(aliases)};\n\n".encode("utf8"))
|
||||
fp.write(f"export const translations = {json.dumps(use_translations)};\n\n".encode("utf8"))
|
||||
fp.write(f"export const meta = {json.dumps(bookmeta)};\n".encode("utf8"))
|
||||
fp.write(f"export const meta = {json.dumps(bookmeta)};\n\n".encode("utf8"))
|
||||
fp.write(f"export const defaulttx = {json.dumps(shorthand_defaults)};\n\n".encode("utf8"))
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue