[sword-svn] r3632 - in trunk: locales.d src/keys src/mgr
scribe at crosswire.org
scribe at crosswire.org
Mon May 20 17:57:40 MST 2019
Author: scribe
Date: 2019-05-20 17:57:40 -0700 (Mon, 20 May 2019)
New Revision: 3632
Modified:
trunk/locales.d/de-utf8.conf
trunk/src/keys/versekey.cpp
trunk/src/mgr/swlocale.cpp
Log:
added new locales section [Pref Abbrevs] to specify a locales preferred short book abbreviation
Modified: trunk/locales.d/de-utf8.conf
===================================================================
--- trunk/locales.d/de-utf8.conf 2019-05-21 00:57:33 UTC (rev 3631)
+++ trunk/locales.d/de-utf8.conf 2019-05-21 00:57:40 UTC (rev 3632)
@@ -71,6 +71,75 @@
Jude=Judas
Revelation of John=Offenbarung
+[Pref Abbrevs]
+Gen=1Mo
+Exod=2Mo
+Lev=3Mo
+Num=4Mo
+Deut=5Mo
+Josh=Jos
+Judg=Rich
+Ruth=Rut
+1Sam=1Sam
+2Sam=2Sam
+1Kgs=1Kön
+2Kgs=2Kön
+1Chr=1Chr
+2Chr=2Chr
+Ezra=Esr
+Neh=Neh
+Esth=Est
+Job=Hiob
+Ps=Ps
+Prov=Sprü
+Eccl=Pred
+Song=Hohes
+Isa=Jesa
+Jer=Jere
+Lam=Klag
+Ezek=Hesek
+Dan=Dan
+Hos=Hos
+Joel=Joel
+Amos=Amos
+Obad=Obad
+Jonah=Jona
+Mic=Micha
+Nah=Nahum
+Hab=Hab
+Zeph=Zeph
+Hag=Hag
+Zech=Sach
+Mal=Mal
+Matt=Matt
+Mark=Mark
+Luke=Luk
+John=Johan
+Acts=Apg
+Rom=Römer
+1Cor=1Kor
+2Cor=2Kor
+Gal=Galat
+Eph=Ephes
+Phil=Phili
+Col=Kol
+1Thess=1Thess
+2Thess=2Thess
+1Tim=1Tim
+2Tim=2Tim
+Titus=Titus
+Phlm=Phile
+Heb=Heb
+Jas=Jak
+1Pet=1Pet
+2Pet=2Pet
+1John=1Joh
+2John=2Joh
+3John=3Joh
+Jude=Judas
+Rev=Apc
+
+
[Book Abbrevs]
1. MOSE=Gen
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2019-05-21 00:57:33 UTC (rev 3631)
+++ trunk/src/keys/versekey.cpp 2019-05-21 00:57:40 UTC (rev 3632)
@@ -1275,7 +1275,7 @@
const char *VerseKey::getBookAbbrev() const {
- return getPrivateLocale()->translate(refSys->getBook(((testament>1)?BMAX[0]:0)+book-1)->getPreferredAbbreviation());
+ return getPrivateLocale()->translate((SWBuf("prefAbbr_")+refSys->getBook(((testament>1)?BMAX[0]:0)+book-1)->getPreferredAbbreviation()).c_str());
}
Modified: trunk/src/mgr/swlocale.cpp
===================================================================
--- trunk/src/mgr/swlocale.cpp 2019-05-21 00:57:33 UTC (rev 3631)
+++ trunk/src/mgr/swlocale.cpp 2019-05-21 00:57:40 UTC (rev 3632)
@@ -109,10 +109,22 @@
entry = p->lookupTable.find(text);
if (entry == p->lookupTable.end()) {
+ SectionMap::iterator secEntry;
ConfigEntMap::iterator confEntry;
- confEntry = localeSource->getSection("Text").find(text);
- if (confEntry == localeSource->getSection("Text").end())
- p->lookupTable.insert(LookupMap::value_type(text, text));
+ SWBuf textBuf = text;
+ if (textBuf.startsWith("prefAbbr_")) {
+ textBuf.stripPrefix('_');
+ secEntry = localeSource->getSections().find("Pref Abbrevs");
+ if (secEntry == localeSource->getSections().end()) {
+ secEntry = localeSource->getSections().find("Text");
+ }
+ }
+ else {
+ secEntry = localeSource->getSections().find("Text");
+ }
+ confEntry = secEntry->second.find(textBuf.c_str());
+ if (confEntry == secEntry->second.end())
+ p->lookupTable.insert(LookupMap::value_type(text, textBuf.c_str()));
else {//valid value found
/*
- If Encoding==Latin1 and we have a StringHelper, convert to UTF-8
More information about the sword-cvs
mailing list