Fixed gh-120 that allows export of component with language translations
This commit is contained in:
@ -1051,7 +1051,7 @@ class Get
|
||||
$component->sales_server_ftp = 0;
|
||||
$component->add_sales_server = 0;
|
||||
}
|
||||
// set the ignore folders for git if found
|
||||
// set the ignore folders for repo if found
|
||||
if (isset($component->toignore) && ComponentbuilderHelper::checkString($component->toignore))
|
||||
{
|
||||
if (strpos($component->toignore, ',') !== false)
|
||||
@ -1065,7 +1065,7 @@ class Get
|
||||
}
|
||||
else
|
||||
{
|
||||
// the default is to ignore the git folder
|
||||
// the default is to ignore the repo folder
|
||||
$component->toignore = array('.git');
|
||||
}
|
||||
|
||||
@ -3387,26 +3387,24 @@ class Get
|
||||
}
|
||||
// if we have an array continue
|
||||
if (isset($this->multiLangString[$string]['translation'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])
|
||||
&& isset($this->multiLangString[$string]['translation']['translation'])
|
||||
&& isset($this->multiLangString[$string]['translation']['language'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['language'])
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['translation']))
|
||||
&& ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']))
|
||||
{
|
||||
// great lets build the multi languages strings
|
||||
foreach ($this->multiLangString[$string]['translation']['translation'] as $at => $lang)
|
||||
foreach ($this->multiLangString[$string]['translation'] as $translations)
|
||||
{
|
||||
$_tag = $this->multiLangString[$string]['translation']['language'][$at];
|
||||
// build arrays
|
||||
if (!isset($this->languages[$_tag]))
|
||||
if (isset($translations['language']) && isset($translations['translation']))
|
||||
{
|
||||
$this->languages[$_tag] = array();
|
||||
// build arrays
|
||||
if (!isset($this->languages[$translations['language']]))
|
||||
{
|
||||
$this->languages[$translations['language']] = array();
|
||||
}
|
||||
if (!isset($this->languages[$translations['language']][$area]))
|
||||
{
|
||||
$this->languages[$translations['language']][$area] = array();
|
||||
}
|
||||
$this->languages[$translations['language']][$area][$placeholder] = $translations['translation'];
|
||||
}
|
||||
if (!isset($this->languages[$_tag][$area]))
|
||||
{
|
||||
$this->languages[$_tag][$area] = array();
|
||||
}
|
||||
$this->languages[$_tag][$area][$placeholder] = $lang;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -3628,7 +3626,7 @@ class Get
|
||||
elseif (ComponentbuilderHelper::checkJson($item['translation']))
|
||||
{
|
||||
$translation = json_decode($item['translation'], true);
|
||||
if (ComponentbuilderHelper::checkArray($translation) && ComponentbuilderHelper::checkArray($translation['translation']))
|
||||
if (ComponentbuilderHelper::checkArray($translation))
|
||||
{
|
||||
// only archive the item and update the string to unlink the current component
|
||||
$this->setUpdateExistingLangStrings($item['id'], $components, 2, $today, $counterUpdate);
|
||||
|
@ -810,14 +810,14 @@ class Structure extends Get
|
||||
|
||||
/**
|
||||
* Set the Static File & Folder
|
||||
*
|
||||
* @param array $target The main target and name
|
||||
*
|
||||
* @param array $target The main target and name
|
||||
* @param string $type The type in the target
|
||||
* @param string $fileName The custom file name
|
||||
* @param array $cofig to add more data to the files info
|
||||
*
|
||||
* @param array $cofig to add more data to the files info
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function buildDynamique($target, $type, $fileName = false, $config = false)
|
||||
{
|
||||
@ -1099,14 +1099,14 @@ class Structure extends Get
|
||||
/**
|
||||
* Remove folders with files
|
||||
*
|
||||
* @param string $dir The path to folder to remove
|
||||
* @param boolean $git if there is a git folder in that must not be removed
|
||||
* @param string $dir The path to folder to remove
|
||||
* @param boolean $ignore The files and folders to ignore
|
||||
*
|
||||
* @return boolean True if all is removed
|
||||
*
|
||||
*/
|
||||
protected function removeFolder($dir, $git = false)
|
||||
protected function removeFolder($dir, $ignore = false)
|
||||
{
|
||||
return ComponentbuilderHelper::removeFolder($dir, $git);
|
||||
return ComponentbuilderHelper::removeFolder($dir, $ignore);
|
||||
}
|
||||
}
|
||||
|
@ -3760,7 +3760,7 @@ class Interpretation extends Fields
|
||||
$script .= PHP_EOL."\t\t\t{";
|
||||
$script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." JSON Decode ".$jsonString.".";
|
||||
if (isset($this->jsonItemBuilderArray[$view])
|
||||
&& ComponentbuilderHelper::checkArray($this->jsonStringBuilderArray[$view])
|
||||
&& ComponentbuilderHelper::checkArray($this->jsonItemBuilderArray[$view])
|
||||
&& in_array($jsonString, $this->jsonItemBuilderArray[$view]))
|
||||
{
|
||||
$makeArray = ',true';
|
||||
|
Reference in New Issue
Block a user