Commit f9e90790 authored by Troy A. Griffitts's avatar Troy A. Griffitts

Added more localized strings. Added enableGospelParallel flag. Added...

Added more localized strings. Added enableGospelParallel flag. Added preferredDevotional flag. Added some scary logic to try to install additional modules on newer releases. Added localization of Daily Devo screen.
parent 6bba7d02
......@@ -142,3 +142,11 @@ Word Study requires a Greek and Hebrew Strongs dictionary. Please install one o
Theme=Theme
Light=Light
Dark=Dark
Show Gospel Parallels=Show Gospel Parallels
# This option is used as a choice for Study Bible to use for Verse Study, Word Study, etc.
# First Active means that the first Bible selected in the 3 display dropdowns which has language data will be used.
# This choice says, "I don't wish to choose a specific Bible, just use the first one I am currently diplaying which has the ability."
First Active=First Active
Nothing to display.=Nothing to display.
No Modules Installed=No Modules Installed
No Modules Available. Try pressing the [↻] button.=No Modules Available. Try pressing the [↻] button.
......@@ -4,6 +4,7 @@ var app = {
enableBibleSync : true,
enableViewTypes : true,
enableDailyDevotionals : true,
enableGospelParallels : true,
bibleSyncRefs : [],
isPopupShowing : false,
basicStartupStage : 0,
......@@ -17,6 +18,7 @@ var app = {
checkDefaultLocale : true,
defaultLocale : 'en',
defaultLocaleName : 'English',
preferredDevotional : 'SME',
appLogo : 'img/swordlogo.png',
appName : 'Bishop',
topBarHeight : 3,
......@@ -574,10 +576,24 @@ console.log('app.firstTime: ' + app.firstTime);
app.getLastAppVersion(function(lastVersion) {
if (lastVersion != app.version) {
app.copyBundledResources('', '', function() {
// since we currently just nuke any top-level bundled resource folder, we can do this for mods.d/
// and modules/ or else other installed modules would be killed. We've added an exception for these
// folders at the root level (kindof a hack but works), but now...
// we really need some way to determine if we have a bundledResource older than something already
// installed and, if so, skip the install, so we don't overwrite an updated module with an older.
// for now replace anything from bundledResources in mods.d and these 2 module paths if exist
app.copyBundledResources('mods.d/', 'mods.d/', function() {
// setting an extraConfig forces a re-init and will pick up newly copied resources
app.setLastAppVersion(function() {
return firstCheck();
app.copyBundledResources('modules/texts/ztext/', 'modules/texts/ztext/', function() {
app.copyBundledResources('modules/', 'modules/', function() {
app.copyBundledResources('modules/lexdict/', 'modules/lexdict/', function() {
app.copyBundledResources('modules/lexdict/zld/', 'modules/lexdict/zld/', function() {
// setting an extraConfig forces a re-init and will pick up newly copied resources
app.setLastAppVersion(function() {
return firstCheck();
});
});
});
});
});
});
});
......@@ -603,9 +619,15 @@ console.log('**** retrieving lastAppVersion: ' + value);
copyBundledResources: function(source, dest, callback) {
if (typeof cordova == 'undefined') return callback?callback():0;
var resPath = cordova.file.applicationDirectory + 'www/bundledResources/' + source;
var checkPath = (dest.indexOf('/') > 0) ? dest.substring(0, dest.indexOf('/')) : dest;
var destPath = [
cordova.file.documentsDirectory + 'sword/',
cordova.file.dataDirectory+dest
{ checkPath : cordova.file.documentsDirectory + 'sword/'+checkPath,
targetPath : cordova.file.documentsDirectory + 'sword/'+dest
},
{
checkPath : cordova.file.dataDirectory+checkPath,
targetPath : cordova.file.dataDirectory+dest
}
];
console.log('*** copying bundled resources... looking at ' +resPath);
var entries = [];
......@@ -633,8 +655,8 @@ console.log('checking to see if destination already exists: '+destBundle.toURL()
// later, it might be good to have some logic which doesn't overwrite files which
// might be newer / updated
// for now, if newer bundled modules exist, a new app rev should be released
if (!entries[i].name.startsWith('mods.d') && !entries[i].name.startsWith('modules')) {
console.log('removing: '+existing.fullPath);
if (!entries[i].name.startsWith('mods.d') && !entries[i].name.startsWith('modules') && !dest.startsWith('modules')) {
console.log('removing: '+entries[i].name + '['+existing.fullPath+']');
existing.removeRecursively(copy, copy);
}
else copy();
......@@ -662,13 +684,12 @@ console.log('ERROR: ' + err);
if (resBundle && resBundle.isDirectory) {
var findDest = function(i) {
if (!i) i = 0;
if (i >= destPath.length) {
}
window.resolveLocalFileSystemURL(destPath[i], function(destBundle) {
if (i >= destPath.length) { if (callback) callback(); return; }
window.resolveLocalFileSystemURL(destPath[i].targetPath, function(destBundle) {
performCopy(resBundle, destBundle);
}, function(err) {
if (i == destPath.length -1) {
console.log('ERROR resolving path: '+JSON.stringify(err));
console.log('ERROR resolving path: '+destPath[i].targetPath+' - '+JSON.stringify(err));
if (callback) callback();
}
findDest(++i);
......@@ -823,7 +844,7 @@ console.log('setShowGospelParallels: ' + value);
var mainMod = app.getCurrentMod1();
console.log('currentMod1 from localStorage: ' + mainMod);
var modOptions = '';
var strongsBibleOptions = '<option value="">First Active</option>';
var strongsBibleOptions = '<option data-english="First Active" value="">First Active</option>';
var appLocaleOptions = '';
app.greekDefMods = [];
app.hebrewDefMods = [];
......@@ -943,7 +964,9 @@ console.log('Installed module: ' + mods[i].name + '; features.length: ' + mods[i
t += '<tr><td class="menuLabel" onclick="app.toggleSettings(); return false;"><img src="img/ic_action_settings.png" style="height:1em;"/> <span data-english="Settings">Settings</span></td></tr>';
t += '<tr><td style="width:100%;"><div class="settingsPanel toshow">';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Word Study Bible">Word Study Bible</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setWordStudyBible($(this).val()); return false;" id="wordStudyBible"></select></div>';
if (app.enableGospelParallels) {
t += '<div style="padding-bottom:.5em;line-height:initial;"><div style="display:inline-block;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Show Gospel Parallels">Show Gospel Parallels</span></div><label style="float:right;" class="switch"><input id="gospelParallelsSwitch" onchange="app.toggleGospelParallels(); return false;" type="checkbox"><span class="slider round"></span></label></div>';
}
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Language">Language</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setAppLocale($(this).val()); return false;" id="appLocale"></select></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<button id="decreaseUIFontButton" onclick="app.decreaseUIFont();return false;" style="width:2em;font-size:130%"> - </button>&nbsp; <span data-english="Font Size">Font Size</span> &nbsp;<button id="increaseUIFontButton" onclick="app.increaseUIFont();return false;" style="width:2em;font-size:130%"> + </button></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Theme">Theme</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setAppTheme($(this).val()); return false;" id="appTheme"></select></div>';
......@@ -1482,7 +1505,7 @@ console.log('parDispModules.length: ' + parDispModules.length);
};
if (!masterModule) {
return chapterDisplay('<center><h2>Nothing to display.</h2></center>');
return chapterDisplay('<center><h2 data-english="Nothing to display.">Nothing to display.</h2></center>');
}
var usedCV = false;
//
......@@ -1789,7 +1812,7 @@ console.log('refreshing sources complete');
installMgr.installModule('CrossWire', 'WLC', function() { ++app.basicStartupStage; app.basicStartup() });
break;
case 7:
installMgr.installModule('CrossWire', 'SME', function() { ++app.basicStartupStage; app.basicStartup() });
installMgr.installModule('CrossWire', app.preferredDevotional, function() { ++app.basicStartupStage; app.basicStartup() });
break;
case 8:
app.setCurrentMod1('KJV');
......
......@@ -70,7 +70,20 @@ console.log('****** lastDevo: ' + lastDevo);
if (!mod) {
var t = '';
t += '<br/>';
t += '<div style="padding:.5em;"><center><span data-english="';
t += '<div style="padding:.5em;"><center>';
/*
t += '<span data-english="';
t += 'Devotional data needs to be installed to use this function. May I now install the preferred devotional module?';
t += '">';
t += 'Devotional data needs to be installed to use this function. May I now install the preferred devotional module?';
t += '</span>';
t += '<br/>';
t += '<br/>';
t += '<button onclick="app.installModule(\''+app.preferredDevotional+'\');return false;" data-english="Install Module">Install Module</button> &nbsp;&nbsp; <button onclick="app.setShowGospelParallels(false); app.popupHide(); return false;" data-english="Cancel">Cancel</button></center>';
t += '<br/>';
t += '<br/>';
*/
t += '<span data-english="';
t += 'Daily devotionals can be installed from the &quot;Library&quot; choice in the side menu.';
t += '">';
t += 'Daily devotionals can be installed from the &quot;Library&quot; choice in the side menu.';
......@@ -82,7 +95,9 @@ console.log('****** lastDevo: ' + lastDevo);
t += 'Select a module source, .e.g., &quot;CrossWire&quot;, and then choose type &quot;Daily Devotionals&quot;.';
t += '</center></div>';
$(target).html(t);
$(target).scrollTop(0);
app.setAppLocale(false, function() {
$(target).scrollTop(0);
});
return;
}
mod.setKeyText(devoKey, function() {
......@@ -95,7 +110,7 @@ console.log('****** lastDevo: ' + lastDevo);
t += '<li><a href="javascript:void(0);" onclick="dailyDevo.whichDay.setDate(dailyDevo.whichDay.getDate()+1); dailyDevo.showDailyDevo(\''+devoName+'\'); return false;"><span data-english="next day" style="white-space:nowrap">next day</span></a></li>';
t += '</ul>';
t += '<h1 style="padding-left:.5em;">';
t += dailyDevo.whichDay.toDateString();
t += dailyDevo.whichDay.toLocaleDateString(undefined, { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' });
t += '</h1>';
t += '<table class="clean" style="width:100%;"><tbody>';
t += '<tr class="roweven" onclick="return false;">';
......@@ -112,8 +127,10 @@ console.log('****** lastDevo: ' + lastDevo);
t += '</ul>';
t += '<div style="height:30em;">&nbsp;</div>';
$(target).html(t);
$(target).scrollTop(0);
window.localStorage.setItem('lastDevo', devoName);
app.setAppLocale(false, function() {
$(target).scrollTop(0);
window.localStorage.setItem('lastDevo', devoName);
});
});
});
});
......
......@@ -53,7 +53,7 @@ var installMgr = {
}
}
if (!modInfoList.length) {
h += '<tr><td style="width:100%;">'+noneMessage+'</td></tr>';
h += '<tr><td style="width:100%;"><span data-enlish="'+noneMessage+'">'+noneMessage+'</span></td></tr>';
}
h += '</tbody></table>';
h += '<br/>';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment