/// <summary> /// When displaying bible verses (on the live screen), the reference shown comes /// from the bible.BibleBooks[?].Long (or .Short) fields. This code sets those /// fields for all bibles in the library to the names found in the user selected /// Sword locales.d file. /// </summary> /// <param name="Bibles"></param> /// <param name="SwordPath"></param> /// <param name="locale"></param> public static void SetBibleLocale(BibleLib Bibles, string SwordPath, string locale) { string localeDir = Path.Combine(SwordPath, "locales.d"); string longFile = Path.Combine(localeDir, locale + ".conf"); string abbrFile = Path.Combine(localeDir, locale + "_abbr.conf"); IniStructure longNames = IniStructure.ReadIni(longFile); IniStructure abbrNames = IniStructure.ReadIni(abbrFile); if (longNames == null) { return; } foreach (string translation in Bibles.Translations()) { BibleVersion bible = Bibles[translation]; int i = 0; foreach (string book in BibleVersion.SwordBookNames) { string localizedName = longNames.GetValue("Text", book); bible.BibleBooks[i].Long = longNames.GetValue("Text", book); if (abbrNames != null) { bible.BibleBooks[i].Short = abbrNames.GetValue("Text", book); } else { bible.BibleBooks[i].Short = longNames.GetValue("Text", book); } i++; } } }
public void Setup(MainForm mf, ListBox btb, BibleLib bibles) { mainForm = mf; BibleText_Bookmarks = btb; this.bibleLib = bibles; }