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:
@ -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 = '';
|
||||
|
Reference in New Issue
Block a user