[sword-svn] r2616 - trunk/utilities
refdoc at crosswire.org
refdoc at crosswire.org
Wed Mar 16 08:29:18 MST 2011
Author: refdoc
Date: 2011-03-16 08:29:18 -0700 (Wed, 16 Mar 2011)
New Revision: 2616
Modified:
trunk/utilities/imp2vs.cpp
Log:
introducing localised keys to imp2vs.cpp
Modified: trunk/utilities/imp2vs.cpp
===================================================================
--- trunk/utilities/imp2vs.cpp 2011-03-15 23:19:59 UTC (rev 2615)
+++ trunk/utilities/imp2vs.cpp 2011-03-16 15:29:18 UTC (rev 2616)
@@ -30,6 +30,7 @@
#include <ztext.h>
#include <lzsscomprs.h>
#include <zipcomprs.h>
+#include <localemgr.h>
#ifndef NO_SWORD_NAMESPACE
using namespace sword;
@@ -58,6 +59,7 @@
fprintf(stderr, "\t\t\t\t\t%s\n", (*loop).c_str());
}
fprintf(stderr, "\n");
+ fprintf(stderr, " -l <locale>\t\t specify a locale scheme to use (default is en)\n");
fprintf(stderr, "'imp' format is a simple standard for importing data into SWORD modules.\n"
"Required is a plain text file containing $$$key lines followed by content.\n\n"
"$$$Gen.1.1\n"
@@ -84,6 +86,8 @@
const char *inFileName = argv[1];
SWBuf v11n = "KJV";
SWBuf outPath = "./";
+ SWBuf locale = "en";
+
bool fourByteSize = false;
bool append = false;
int iType = 4;
@@ -122,6 +126,10 @@
if (i+1 < argc) v11n = argv[++i];
else usage(progName, "-v requires <v11n>");
}
+ else if (!strcmp(argv[i], "-l")) {
+ if (i+1 < argc) locale = argv[++i];
+ else usage(progName, "-l requires <locale>");
+ }
else usage(progName, (((SWBuf)"Unknown argument: ")+ argv[i]).c_str());
}
// -----------------------------------------------------
@@ -178,9 +186,14 @@
: (SWModule *)new RawText4(outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, v11n);
}
// -----------------------------------------------------
+
+ // setup locale manager
+
+ LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale);
// setup module key to allow full range of possible values, and then some
+
VerseKey *vkey = (VerseKey *)module->CreateKey();
vkey->Headings(1);
vkey->AutoNormalize(0);
More information about the sword-cvs
mailing list