diff --git a/workflow/engine/bin/tasks/cliMafe.php b/workflow/engine/bin/tasks/cliMafe.php new file mode 100644 index 000000000..d0655eede --- /dev/null +++ b/workflow/engine/bin/tasks/cliMafe.php @@ -0,0 +1,65 @@ +. + * + * For more information, contact Colosa Inc, 2566 Le Jeune Rd., + * Coral Gables, FL, 33134, USA, or email info@colosa.com. + * + * @package workflow-engine-bin-tasks + */ +G::LoadClass("system"); +G::LoadClass("wsTools"); + + +CLI::taskName('mafe-translation'); +CLI::taskDescription(<<setRootDir($rootDir); + $loadConstants = false; + + $workspaces = get_workspaces_from_args($args); + $lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en'; + + $translation = new Translation(); + CLI::logging("Updating labels Mafe ...\n"); + foreach ($workspaces as $workspace) { + try { + echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n"; + $app->loadEnvironment($workspace->name, $loadConstants); + $translation->generateTransaltionMafe($lang); + } catch (Exception $e) { + echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n"; + } + } + + CLI::logging("Create successful\n"); + +} diff --git a/workflow/engine/classes/model/Translation.php b/workflow/engine/classes/model/Translation.php index b6508cfb8..1f7347475 100755 --- a/workflow/engine/classes/model/Translation.php +++ b/workflow/engine/classes/model/Translation.php @@ -573,5 +573,18 @@ class Translation extends BaseTranslation } return false; } + + public function generateTransaltionMafe ($lang='en') + { + if (!file_exists(PATH_TRUNK .'vendor/colosa/MichelangeloFE/' . 'labels.php')) { + throw new Exception( 'labels.php not exist in MAFE '); + } + + include PATH_TRUNK .'vendor/colosa/MichelangeloFE/' . 'labels.php'; + + foreach ($labels as $key => $row) { + $this->addTranslation ('LABEL', 'ID_MAFE_'.MD5($row), $lang, $row); + } + } } diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 10755be86..5e8cd6b4c 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -112,10 +112,10 @@ -
  • +