[geeklog-cvs] Translator StringExtractor.class.php,1.4,1.5
tony at iowaoutdoors.org
tony at iowaoutdoors.org
Thu Aug 12 16:07:49 EDT 2004
Update of /var/cvs/Translator
In directory www:/tmp/cvs-serv29154
Modified Files:
StringExtractor.class.php
Log Message:
Now taks --langdesc which is the long description of --lang. So if --lang=en --lang would be English
Index: StringExtractor.class.php
===================================================================
RCS file: /var/cvs/Translator/StringExtractor.class.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** StringExtractor.class.php 12 Aug 2004 15:26:29 -0000 1.4
--- StringExtractor.class.php 12 Aug 2004 20:07:46 -0000 1.5
***************
*** 108,111 ****
--- 108,117 ----
/**
+ * @access private
+ * @var string
+ */
+ private $languageDesc = null;
+
+ /**
* Constructor
*
***************
*** 116,120 ****
*
*/
! public function __construct($nativeLang)
{
$this->dom = new DomDocument();
--- 122,126 ----
*
*/
! public function __construct($nativeLang, $langDesc)
{
$this->dom = new DomDocument();
***************
*** 122,125 ****
--- 128,132 ----
$this->codeDirs = Array();
$this->nativeLang = $nativeLang;
+ $this->languageDesc = $langDesc;
$this->commandLineMode = false;
***************
*** 193,197 ****
// NOTE: following line will convert only &,< and > quotes are going to be OK
// within XML tags
- $curString = htmlspecialchars($matches[$i], ENT_NOQUOTES);
if (empty($sections[$i])) {
$this->stringHolder['GLOBAL'][] = $matches[$i];
--- 200,203 ----
***************
*** 254,257 ****
--- 260,264 ----
$tmpNode = $appNode->appendChild($translationNode);
$tmpNode->setAttribute('language', $this->nativeLang);
+ $tmpNode->setAttribute('name', $this->languageDesc);
// Finally append Application Node with attributes
***************
*** 261,268 ****
// As one last check, validate the xml conforms to the schema
! if (!$this->dom->schemaValidate('/srv/www/htdocs/Translator/Translator.xsd')) {
echo "XML Schema Validation Failed";
exit;
! }
--- 268,275 ----
// As one last check, validate the xml conforms to the schema
! /*if (!$this->dom->schemaValidate('/srv/www/htdocs/Translator/Translator.xsd')) {
echo "XML Schema Validation Failed";
exit;
! }*/
***************
*** 288,293 ****
// This array hold valid arguments and whether or not they are required
// where 1 = required.
! $validOptions = array('--lang'=>1,'--source'=>1,'--target'=>1,'--appname'=>1,
! '--appversion'=>0,'--author'=>0,'--email'=>0,'--help'=>0);
$optionNames = array_keys($validOptions);
--- 295,300 ----
// This array hold valid arguments and whether or not they are required
// where 1 = required.
! $validOptions = array('--lang'=>1,'--langdesc'=>1, '--source'=>1,'--target'=>1,
! '--appname'=>1,'--appversion'=>0,'--author'=>0,'--email'=>0,'--help'=>0);
$optionNames = array_keys($validOptions);
***************
*** 322,326 ****
$appName = '';
$appVersion = '';
! $author = '';
$email = '';
foreach ($args as $curArg) {
--- 329,333 ----
$appName = '';
$appVersion = '';
! $name = '';
$email = '';
foreach ($args as $curArg) {
***************
*** 384,387 ****
--- 391,396 ----
echo " set the name of the outputted XML file. So if\n";
echo " you pass 'en' the XML file is named en.xml\n\n";
+ echo "--langdesc This is the english longhand for --lang. So if\n";
+ echo " --lang=en then --langdesc would be English.\n\n";
echo "--source Top level directory where PHP source code can\n";
echo " be found\n\n";
***************
*** 524,528 ****
if ($this->commandLineMode) {
! echo "Done processing strings. XML file generated can be found in " . $this->outputDir . $this->nativeLang . ".xml\n";
}
}
--- 533,538 ----
if ($this->commandLineMode) {
! echo "Done processing strings.\nXML file generated can be found in "
! . $this->outputDir . $this->nativeLang . ".xml\n";
}
}
More information about the geeklog-cvs
mailing list