Added the global switch to set the percentage a language should be translated before it is automatically added to the component during compilation. Force language to be added when the debug lines are set to be added.
This commit is contained in:
@ -136,7 +136,7 @@ class Compiler extends Infusion
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Compiler '.$nr.']';
|
||||
}
|
||||
|
@ -160,7 +160,14 @@ class Get
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $loadLineNr = false;
|
||||
public $debugLinenr = false;
|
||||
|
||||
/*
|
||||
* The percentage when a language should be added
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $percentageLanguageAdd = 0;
|
||||
|
||||
/**
|
||||
* The Placholder Language prefix
|
||||
@ -496,7 +503,7 @@ class Get
|
||||
$this->addPlaceholders = ((int) $config['addPlaceholders'] == 0) ? false : (((int) $config['addPlaceholders'] == 1) ? true : $global);
|
||||
// set if line numbers should be added to comments
|
||||
$global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'debug_linenr') == 1) ? true:false;
|
||||
$this->loadLineNr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global);
|
||||
$this->debugLinenr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global);
|
||||
// set the current user
|
||||
$this->user = JFactory::getUser();
|
||||
// Get a db connection.
|
||||
@ -511,7 +518,9 @@ class Get
|
||||
}
|
||||
// get the component data
|
||||
$this->componentData = $this->getComponentData();
|
||||
|
||||
// set the percentage when a language can be added
|
||||
$this->percentageLanguageAdd = (int) $this->params->get('percentageLanguageAdd', 50);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -528,7 +537,7 @@ class Get
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Get '.$nr.']';
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ class Structure extends Get
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Structure '.$nr.']';
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ class Fields extends Structure
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Fields '.$nr.']';
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ class Interpretation extends Fields
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Interpretation '.$nr.']';
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class Infusion extends Interpretation
|
||||
*/
|
||||
private function setLine($nr)
|
||||
{
|
||||
if ($this->loadLineNr)
|
||||
if ($this->debugLinenr)
|
||||
{
|
||||
return ' [Infusion '.$nr.']';
|
||||
}
|
||||
@ -1110,13 +1110,17 @@ class Infusion extends Interpretation
|
||||
{
|
||||
foreach ($areas as $area => $languageStrings)
|
||||
{
|
||||
// check if we sould install this translation (must be atleast 50% ready
|
||||
$dif = bcdiv(count($languageStrings), $mainLangLoader[$area]);
|
||||
$percentage = bcmul($dif, 100);
|
||||
if ($percentage < 50)
|
||||
// force load if debug lines are added
|
||||
if (!$this->debugLinenr)
|
||||
{
|
||||
// dont add
|
||||
continue;
|
||||
// check if we sould install this translation
|
||||
$dif = bcdiv(count($languageStrings), $mainLangLoader[$area]);
|
||||
$percentage = bcmul($dif, 100);
|
||||
if ($percentage < $this->percentageLanguageAdd)
|
||||
{
|
||||
// dont add
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$p = 'admin';
|
||||
$t = '';
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage headercheck.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage batch_.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage indenter.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage js.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.4.2
|
||||
@build 5th April, 2017
|
||||
@build 6th April, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage minify.php
|
||||
|
Reference in New Issue
Block a user