summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-18 00:01:39 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-18 00:01:39 +0000
commit8c1f6006114b9bae79b869ae4e51bc35836a3270 (patch)
treef744efd97777896f9bc85499c20ddd254252a090
parentc92ef7aced82ba48549bada37b4dcd9091017fd6 (diff)
Corrections based on feedback
-rw-r--r--core/libraries/L10n_Scanner.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/libraries/L10n_Scanner.php b/core/libraries/L10n_Scanner.php
index 30fe97c7..85b54ef3 100644
--- a/core/libraries/L10n_Scanner.php
+++ b/core/libraries/L10n_Scanner.php
@@ -58,7 +58,7 @@ class L10n_Scanner_Core {
new L10n_Scanner_Directory_Filter_Iterator(
new RecursiveDirectoryIterator(DOCROOT))));
foreach ($dir as $file) {
- if (strtolower(substr(strrchr($file->getFilename(), '.'), 1)) == "php") {
+ if substr(strrchr($file->getFilename(), '.'), 1) == "php") {
$this->_scan_php_file($file, $this);
} else {
$this->_scan_info_file($file, $this);
@@ -111,10 +111,11 @@ class L10n_Scanner_Core {
private function _scan_info_file($file, &$message_handler) {
$code = file_get_contents($file);
- print $code . "\n";
- if (preg_match("#description\s*?=\s*(.*)\n#", $code, $matches)) {
- print $matches[1] . "\n";
- $message_handler->process_message($matches[1]);
+ if (preg_match("#name\s*?=\s*(.*?)\ndescription\s*?=\s*(.*)\n#", $code, $matches)) {
+ unset($matches[0]);
+ foreach ($matches as $string) {
+ $message_handler->process_message($string);
+ }
}
}
@@ -127,7 +128,7 @@ class L10n_Scanner_Core {
if ($parens == "(") {
if (in_array($next_token, array(")", ","))
- && (is_array($first_param) && ($first_param[0] == T_CONSTANT_ENCAPSED_STRING))) {
+ && (is_array($first_param) && ($first_param[0] == T_CONSTANT_ENCAPSED_STRING))) {x
$message = self::_escape_quoted_string($first_param[1]);
$message_handler->process_message($message);
} else {
@@ -201,7 +202,6 @@ class L10n_Scanner_File_Filter_Iterator extends FilterIterator {
function accept() {
// Skip anything that doesn't need to be localized.
$filename = $this->getInnerIterator()->getFilename();
- $ext = strtolower(substr(strrchr($filename, '.'), 1));
- return in_array($ext, array("php", "info"));
+ return in_array(substr(strrchr($filename, '.'), 1), array("php", "info"));
}
}