PM-3646
This commit is contained in:
committed by
Enrique Ponce De Leon
parent
1d4efa7005
commit
b89b14b325
@@ -135,7 +135,7 @@ class Language extends BaseLanguage
|
|||||||
$oTranslation = new Translation();
|
$oTranslation = new Translation();
|
||||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||||
if (file_exists($MichelangeloFE)) {
|
if (file_exists($MichelangeloFE)) {
|
||||||
$labels = $this->readLabelsDirectory($MichelangeloFE, true);
|
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||||
foreach ($labels as $label) {
|
foreach ($labels as $label) {
|
||||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ class Language extends BaseLanguage
|
|||||||
$oTranslation = new Translation();
|
$oTranslation = new Translation();
|
||||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||||
if (file_exists($MichelangeloFE)) {
|
if (file_exists($MichelangeloFE)) {
|
||||||
$labels = $this->readLabelsDirectory($MichelangeloFE, true);
|
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||||
foreach ($labels as $label) {
|
foreach ($labels as $label) {
|
||||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||||
}
|
}
|
||||||
@@ -839,23 +839,23 @@ class Language extends BaseLanguage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readLabelsDirectory($path, $unique = false)
|
public static function readLabelsDirectory($path, $unique = false)
|
||||||
{
|
{
|
||||||
$labels = array();
|
$labels = array();
|
||||||
$items = opendir($path);
|
$items = opendir($path);
|
||||||
while (false !== ($item = readdir($items))) {
|
while (false !== ($item = readdir($items))) {
|
||||||
$a = $path . "/" . $item;
|
$a = $path . "/" . $item;
|
||||||
if ($item !== "." && $item !== ".." && is_dir($a)) {
|
if ($item !== "." && $item !== ".." && is_dir($a)) {
|
||||||
$labels = array_merge($labels, $this->readLabelsDirectory($a, false));
|
$labels = array_merge($labels, self::readLabelsDirectory($a, false));
|
||||||
}
|
}
|
||||||
if (is_file($a)) {
|
if (is_file($a)) {
|
||||||
$info = pathinfo($a);
|
$info = pathinfo($a);
|
||||||
if ($info["extension"] === "js" || $info["extension"] === "JS") {
|
if ($info["extension"] === "js" || $info["extension"] === "JS") {
|
||||||
$file = file_get_contents($a);
|
$file = file_get_contents($a);
|
||||||
//search string 'xx\'xx\'xx'.translate()
|
//search string 'xx\'xx\'xx'.translate()
|
||||||
$labels = array_merge($labels, $this->readLabelsFile($file, "'"));
|
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
|
||||||
//search string "xx\"xx\"xx".translate()
|
//search string "xx\"xx\"xx".translate()
|
||||||
$labels = array_merge($labels, $this->readLabelsFile($file, "\""));
|
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -866,7 +866,7 @@ class Language extends BaseLanguage
|
|||||||
return $labels;
|
return $labels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function readLabelsFile($file, $sep)
|
public static function readLabelsFile($file, $sep)
|
||||||
{
|
{
|
||||||
$labels = array();
|
$labels = array();
|
||||||
$k = 0;
|
$k = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user