Added complete NLT (New Living Translation) support and NKJV fixes
**NLT Integration:** - Added NLT directory structure matching ESV/NKJV pattern - Updated Dockerfile to COPY NLT /app/NLT - Added NLT_DATA_DIR path and search engine initialization - Updated getDataDir and /versions endpoints to support NLT - Frontend will automatically include NLT in version dropdown **NKJV Fixes:** - Fixed thousands of NKJV chapter files (encoding, formatting issues) - All NKJV content now serves correctly - Preserves existing favorites and search functionality **Complete 3-Version Bible Library:** - ESV (English Standard Version) ✓ - NKJV (New King James Version) ✓ - NLT (New Living Translation) ✓ All versions now follow consistent directory structure and Docker integration!
This commit is contained in:
@@ -38,10 +38,12 @@ app.use('/logos', express.static(path.join(__dirname, '../../frontend/logos')));
|
||||
// Bible data directories
|
||||
const ESV_DATA_DIR = path.join(__dirname, '../../ESV'); // ESV local files
|
||||
const NKJV_DATA_DIR = path.join(__dirname, '../../NKJV'); // NKJV local files
|
||||
const NLT_DATA_DIR = path.join(__dirname, '../../NLT'); // NLT local files
|
||||
|
||||
// Initialize search engines for each version
|
||||
let esvSearchEngine = null;
|
||||
let nkjvSearchEngine = null;
|
||||
let nltSearchEngine = null;
|
||||
|
||||
try {
|
||||
if (ESV_DATA_DIR) {
|
||||
@@ -57,10 +59,17 @@ try {
|
||||
console.log('NKJV search engine failed to initialize:', error.message);
|
||||
}
|
||||
|
||||
try {
|
||||
nltSearchEngine = new BibleSearchEngine(NLT_DATA_DIR);
|
||||
} catch (error) {
|
||||
console.log('NLT search engine failed to initialize:', error.message);
|
||||
}
|
||||
|
||||
// Helper function to get data directory for version
|
||||
function getDataDir(version) {
|
||||
if (version === 'esv' && esvSearchEngine) return ESV_DATA_DIR;
|
||||
if (version === 'nkjv') return NKJV_DATA_DIR;
|
||||
if (version === 'nlt' && nltSearchEngine) return NLT_DATA_DIR;
|
||||
return esvSearchEngine ? ESV_DATA_DIR : NKJV_DATA_DIR; // default to available version
|
||||
}
|
||||
|
||||
@@ -124,6 +133,7 @@ app.get('/versions', (req, res) => {
|
||||
const availableVersions = [];
|
||||
if (esvSearchEngine) availableVersions.push({ id: 'esv', name: 'ESV - English Standard Version' });
|
||||
availableVersions.push({ id: 'nkjv', name: 'NKJV - New King James Version' });
|
||||
if (nltSearchEngine) availableVersions.push({ id: 'nlt', name: 'NLT - New Living Translation' });
|
||||
|
||||
res.json({ versions: availableVersions });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user