Improved JCB to now be able to have other languanges then en-GB as its base/main/global language. This will allow you to build your components in a language of your choice.

This commit is contained in:
Llewellyn van der Merwe 2018-04-20 01:36:21 +02:00
parent d1813147d3
commit 4b57e69edb
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
19 changed files with 109 additions and 73 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.5) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.6) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -127,12 +127,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 19th April, 2018 + *Last Build*: 19th April, 2018
+ *Version*: 2.7.5 + *Version*: 2.7.6
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **183282** + *Line count*: **183307**
+ *Field count*: **1013** + *Field count*: **1013**
+ *File count*: **1199** + *File count*: **1200**
+ *Folder count*: **193** + *Folder count*: **193**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.5) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.6) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -127,12 +127,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 19th April, 2018 + *Last Build*: 19th April, 2018
+ *Version*: 2.7.5 + *Version*: 2.7.6
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **183282** + *Line count*: **183307**
+ *Field count*: **1013** + *Field count*: **1013**
+ *File count*: **1199** + *File count*: **1200**
+ *Folder count*: **193** + *Folder count*: **193**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -204,7 +204,14 @@ class Get
* *
* @var array * @var array
*/ */
public $languages = array('en-GB' => array()); public $languages = array();
/**
* The Main Languages
*
* @var string
*/
public $langTag = 'en-GB';
/** /**
* The Multi Languages bucket * The Multi Languages bucket
@ -642,6 +649,10 @@ class Get
$this->params = JComponentHelper::getParams('com_componentbuilder'); $this->params = JComponentHelper::getParams('com_componentbuilder');
// set the minfy switch of the JavaScript // set the minfy switch of the JavaScript
$this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0); $this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0);
// set the global language
$this->langTag = $this->params->get('language', $this->langTag);
// setup the main language array
$this->languages[$this->langTag] = array();
// check if we have Tidy enabled // check if we have Tidy enabled
$this->tidy = extension_loaded('Tidy'); $this->tidy = extension_loaded('Tidy');
// set the field type builder // set the field type builder
@ -4516,8 +4527,8 @@ class Get
$query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a'));
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
{ {
$query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.entranslation', 'a.components', 'a.published'))); $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.published')));
$query->where($this->db->quoteName('a.entranslation') . ' IN (' . implode(',', array_map(function($a) $query->where($this->db->quoteName('a.source') . ' IN (' . implode(',', array_map(function($a)
{ {
return $this->db->quote($a); return $this->db->quote($a);
}, $values)) . ')'); }, $values)) . ')');
@ -4525,7 +4536,7 @@ class Get
$this->db->execute(); $this->db->execute();
if ($this->db->getNumRows()) if ($this->db->getNumRows())
{ {
return $this->db->loadAssocList('entranslation'); return $this->db->loadAssocList('source');
} }
} }
return false; return false;
@ -4543,7 +4554,7 @@ class Get
$counterInsert = 0; $counterInsert = 0;
$counterUpdate = 0; $counterUpdate = 0;
$today = JFactory::getDate()->toSql(); $today = JFactory::getDate()->toSql();
foreach ($this->languages['en-GB'] as $area => $placeholders) foreach ($this->languages[$this->langTag] as $area => $placeholders)
{ {
foreach ($placeholders as $placeholder => $string) foreach ($placeholders as $placeholder => $string)
{ {
@ -4630,7 +4641,7 @@ class Get
// add the new lang placeholder to the db // add the new lang placeholder to the db
$this->newLangStrings[$counterInsert] = array(); $this->newLangStrings[$counterInsert] = array();
$this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' $this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components'
$this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'entranslation' $this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'source'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published'
$this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' $this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created'
$this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' $this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by'
@ -4668,7 +4679,7 @@ class Get
$query = $this->db->getQuery(true); $query = $this->db->getQuery(true);
$continue = false; $continue = false;
// Insert columns. // Insert columns.
$columns = array('components', 'entranslation', 'published', 'created', 'created_by', 'version', 'access'); $columns = array('components', 'source', 'published', 'created', 'created_by', 'version', 'access');
// Prepare the insert query. // Prepare the insert query.
$query->insert($this->db->quoteName('#__componentbuilder_language_translation')); $query->insert($this->db->quoteName('#__componentbuilder_language_translation'));
$query->columns($this->db->quoteName($columns)); $query->columns($this->db->quoteName($columns));
@ -4763,7 +4774,7 @@ class Get
$query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a'));
$query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components'))); $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components')));
// get all string that are not linked to this component // get all string that are not linked to this component
$query->where($this->db->quoteName('a.entranslation') . ' NOT IN (' . implode(',', array_map(function($a) $query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a)
{ {
return $this->db->quote($a); return $this->db->quote($a);
}, $values)) . ')'); }, $values)) . ')');

View File

@ -1270,7 +1270,7 @@ class Interpretation extends Fields
$method[] = "\t\t\$lang = JFactory::getLanguage();"; $method[] = "\t\t\$lang = JFactory::getLanguage();";
$method[] = "\t\t\$extension = 'com_users';"; $method[] = "\t\t\$extension = 'com_users';";
$method[] = "\t\t\$base_dir = JPATH_SITE;"; $method[] = "\t\t\$base_dir = JPATH_SITE;";
$method[] = "\t\t\$language_tag = 'en-GB';"; $method[] = "\t\t\$language_tag = '".$this->langTag."';";
$method[] = "\t\t\$reload = true;"; $method[] = "\t\t\$reload = true;";
$method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; $method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
$method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user regestration model"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user regestration model";
@ -1351,7 +1351,7 @@ class Interpretation extends Fields
$method[] = "\t\t\$lang = JFactory::getLanguage();"; $method[] = "\t\t\$lang = JFactory::getLanguage();";
$method[] = "\t\t\$extension = 'com_users';"; $method[] = "\t\t\$extension = 'com_users';";
$method[] = "\t\t\$base_dir = JPATH_ADMINISTRATOR;"; $method[] = "\t\t\$base_dir = JPATH_ADMINISTRATOR;";
$method[] = "\t\t\$language_tag = 'en-GB';"; $method[] = "\t\t\$language_tag = '".$this->langTag."';";
$method[] = "\t\t\$reload = true;"; $method[] = "\t\t\$reload = true;";
$method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; $method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
$method[] = "\t\t// load the user model"; $method[] = "\t\t// load the user model";
@ -6092,7 +6092,7 @@ class Interpretation extends Fields
{ {
ksort($this->langContent['admin']); ksort($this->langContent['admin']);
// load to global languages // load to global languages
$this->languages['en-GB']['admin'] = $this->langContent['admin']; $this->languages[$this->langTag]['admin'] = $this->langContent['admin'];
// remove tmp array // remove tmp array
unset($this->langContent['admin']); unset($this->langContent['admin']);
@ -6145,7 +6145,7 @@ class Interpretation extends Fields
{ {
ksort($this->langContent['site']); ksort($this->langContent['site']);
// load to global languages // load to global languages
$this->languages['en-GB']['site'] = $this->langContent['site']; $this->languages[$this->langTag]['site'] = $this->langContent['site'];
// remove tmp array // remove tmp array
unset($this->langContent['site']); unset($this->langContent['site']);
@ -6173,7 +6173,7 @@ class Interpretation extends Fields
{ {
ksort($this->langContent['sitesys']); ksort($this->langContent['sitesys']);
// load to global languages // load to global languages
$this->languages['en-GB']['sitesys'] = $this->langContent['sitesys']; $this->languages[$this->langTag]['sitesys'] = $this->langContent['sitesys'];
// remove tmp array // remove tmp array
unset($this->langContent['sitesys']); unset($this->langContent['sitesys']);
@ -6196,7 +6196,7 @@ class Interpretation extends Fields
{ {
ksort($this->langContent['adminsys']); ksort($this->langContent['adminsys']);
// load to global languages // load to global languages
$this->languages['en-GB']['adminsys'] = $this->langContent['adminsys']; $this->languages[$this->langTag]['adminsys'] = $this->langContent['adminsys'];
// remove tmp array // remove tmp array
unset($this->langContent['adminsys']); unset($this->langContent['adminsys']);

View File

@ -1078,26 +1078,26 @@ class Infusion extends Interpretation
// check the admin lang is set // check the admin lang is set
if ($this->setLangAdmin()) if ($this->setLangAdmin())
{ {
$values[] = array_values($this->languages['en-GB']['admin']); $values[] = array_values($this->languages[$this->langTag]['admin']);
$mainLangLoader['admin'] = count($this->languages['en-GB']['admin']); $mainLangLoader['admin'] = count($this->languages[$this->langTag]['admin']);
} }
// check the admin system lang is set // check the admin system lang is set
if ($this->setLangAdminSys()) if ($this->setLangAdminSys())
{ {
$values[] = array_values($this->languages['en-GB']['adminsys']); $values[] = array_values($this->languages[$this->langTag]['adminsys']);
$mainLangLoader['adminsys'] = count($this->languages['en-GB']['adminsys']); $mainLangLoader['adminsys'] = count($this->languages[$this->langTag]['adminsys']);
} }
// check the site lang is set // check the site lang is set
if (!$this->removeSiteFolder && $this->setLangSite()) if (!$this->removeSiteFolder && $this->setLangSite())
{ {
$values[] = array_values($this->languages['en-GB']['site']); $values[] = array_values($this->languages[$this->langTag]['site']);
$mainLangLoader['site'] = count($this->languages['en-GB']['site']); $mainLangLoader['site'] = count($this->languages[$this->langTag]['site']);
} }
// check the site system lang is set // check the site system lang is set
if (!$this->removeSiteFolder && $this->setLangSiteSys()) if (!$this->removeSiteFolder && $this->setLangSiteSys())
{ {
$values[] = array_values($this->languages['en-GB']['sitesys']); $values[] = array_values($this->languages[$this->langTag]['sitesys']);
$mainLangLoader['sitesys'] = count($this->languages['en-GB']['sitesys']); $mainLangLoader['sitesys'] = count($this->languages[$this->langTag]['sitesys']);
} }
$values = array_unique(ComponentbuilderHelper::mergeArrays($values)); $values = array_unique(ComponentbuilderHelper::mergeArrays($values));
// get the other lang strings if there is any // get the other lang strings if there is any
@ -1118,8 +1118,8 @@ class Infusion extends Interpretation
$tag = trim($tag); $tag = trim($tag);
foreach ($areas as $area => $languageStrings) foreach ($areas as $area => $languageStrings)
{ {
// only log messages for none en-GB translations // only log messages for none $this->langTag translations
if ('en-GB' !== $tag) if ($this->langTag !== $tag)
{ {
$langStringNr = count($languageStrings); $langStringNr = count($languageStrings);
$langStringSum = $this->bcmath('mul', $langStringNr, 100); $langStringSum = $this->bcmath('mul', $langStringNr, 100);
@ -1132,12 +1132,12 @@ class Infusion extends Interpretation
if ($percentage < $this->percentageLanguageAdd) if ($percentage < $this->percentageLanguageAdd)
{ {
// dont add // dont add
$this->langNot[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total en-GB strings) only <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage; $this->langNot[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total '.$this->langTag.' strings) only <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage;
continue; continue;
} }
} }
// show if it was added as well // show if it was added as well
$this->langSet[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total en-GB strings) and <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage; $this->langSet[$area . ' ' . $tag] = '<b>' . $mainLangLoader[$area] . '</b>(total '.$this->langTag.' strings) and <b>' . $langStringNr . '</b>' . $stringNAme . ' = ' . $percentage;
} }
// set naming convention // set naming convention
$p = 'admin'; $p = 'admin';

View File

@ -4786,10 +4786,6 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_DESC="The date this Langu
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_LABEL="Created Date"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_DETAILS="Details" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_DETAILS="Details"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT="Editing the Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT="Editing the Language Translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION="Entranslation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_HINT="Automatically generated!"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL="English String"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_MESSAGE="Error! Please English translated string here."
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS="Another Language Translation has the same alias." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS="Another Language Translation has the same alias."
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ID="Id" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ID="Id"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE="Language" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE="Language"
@ -4803,6 +4799,10 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PUBLISHING="Publishing" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Language Translation to customise the alias." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Language Translation to customise the alias."
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE="Source"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_HINT="Automatically generated!"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_LABEL="Source String"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_MESSAGE="Error! Please source translated string here."
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_STATUS="Status" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_STATUS="Status"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION="Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION="Translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_DESCRIPTION="The translation strings." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_DESCRIPTION="The translation strings."

View File

@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm(); $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array( $fields = $displayData->get('fields') ?: array(
'entranslation', 'source',
'translation', 'translation',
'components' 'components'
); );

View File

@ -85,18 +85,18 @@
filter="unset" filter="unset"
/> />
<!-- Dynamic Fields. --> <!-- Dynamic Fields. -->
<!-- Entranslation Field. Type: Textarea. (joomla) --> <!-- Source Field. Type: Textarea. (joomla) -->
<field <field
type="textarea" type="textarea"
name="entranslation" name="source"
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL" label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_LABEL"
rows="4" rows="4"
cols="5" cols="5"
description="JFIELD_TITLE_DESC" description="JFIELD_TITLE_DESC"
message="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_MESSAGE" message="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_MESSAGE"
class="text_area span12" class="text_area span12"
filter="STRING" filter="safehtml"
hint="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_HINT" hint="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_HINT"
readonly="true" readonly="true"
disabled="true" disabled="true"
/> />

View File

@ -470,12 +470,19 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
$user = JFactory::getUser(); $user = JFactory::getUser();
// remove header if it has headers // remove header if it has headers
$id_key = $data['target_headers']['id']; $id_key = $data['target_headers']['id'];
$english_key = $data['target_headers']['English']; if (isset($data['target_headers']['Source']))
{
$source_key = $data['target_headers']['Source'];
}
else
{
$source_key = $data['target_headers']['English'];
}
// get the first array set // get the first array set
$firstSet = reset($data['array']); $firstSet = reset($data['array']);
// check if first array is a header array and remove if true // check if first array is a header array and remove if true
if($firstSet[$id_key] == 'id' || $firstSet[$english_key] == 'English') if($firstSet[$id_key] == 'id' || $firstSet[$source_key] == 'Source' || $firstSet[$source_key] == 'English')
{ {
array_shift($data['array']); array_shift($data['array']);
} }
@ -504,7 +511,7 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
->select($db->quoteName(array('version', 'translation'))) ->select($db->quoteName(array('version', 'translation')))
->from($db->quoteName('#__componentbuilder_'.$table)) ->from($db->quoteName('#__componentbuilder_'.$table))
->where($db->quoteName('id') . ' = '. $db->quote($row[$id_key])) ->where($db->quoteName('id') . ' = '. $db->quote($row[$id_key]))
->where($db->quoteName('entranslation') . ' = '. $db->quote($row[$english_key])); ->where($db->quoteName('source') . ' = '. $db->quote($row[$source_key]));
// Reset the query using our newly populated query object. // Reset the query using our newly populated query object.
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
@ -538,7 +545,7 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
foreach($row as $key => $cell) foreach($row as $key => $cell)
{ {
// ignore column // ignore column
if ('IGNORE' === $target[$key] || 'modified_by' === $target[$key] || 'modified' === $target[$key] || 'English' === $target[$key] ) if ('IGNORE' === $target[$key] || 'modified_by' === $target[$key] || 'modified' === $target[$key] || 'Source' === $target[$key] || 'English' === $target[$key] )
{ {
continue; continue;
} }

View File

@ -614,9 +614,9 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
} }
// Only for strings // Only for strings
if (ComponentbuilderHelper::checkString($this->table->entranslation) && !is_numeric($this->table->entranslation)) if (ComponentbuilderHelper::checkString($this->table->source) && !is_numeric($this->table->source))
{ {
$this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation); $this->table->source = $this->generateUniqe('source',$this->table->source);
} }
// insert all set values // insert all set values

View File

@ -44,7 +44,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
'a.ordering','ordering', 'a.ordering','ordering',
'a.created_by','created_by', 'a.created_by','created_by',
'a.modified_by','modified_by', 'a.modified_by','modified_by',
'a.entranslation','entranslation' 'a.source','source'
); );
} }
@ -65,8 +65,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{ {
$this->context .= '.' . $layout; $this->context .= '.' . $layout;
} }
$entranslation = $this->getUserStateFromRequest($this->context . '.filter.entranslation', 'filter_entranslation'); $source = $this->getUserStateFromRequest($this->context . '.filter.source', 'filter_source');
$this->setState('filter.entranslation', $entranslation); $this->setState('filter.source', $source);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting); $this->setState('filter.sorting', $sorting);
@ -153,11 +153,11 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// load the languages to the string // load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket)) if (ComponentbuilderHelper::checkArray($langBucket))
{ {
$item->entranslation = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150) . $componentCounter; $item->source = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
} }
else else
{ {
$item->entranslation = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150) . $componentCounter; $item->source = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
} }
} }
} }
@ -187,7 +187,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{ {
$item->{$lanTag} = ''; $item->{$lanTag} = '';
} }
// now adapt the entranslation // now adapt the source
if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation)) if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation))
{ {
$translations = json_decode($item->translation, true); $translations = json_decode($item->translation, true);
@ -268,7 +268,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
else else
{ {
$search = $db->quote('%' . $db->escape($search) . '%'); $search = $db->quote('%' . $db->escape($search) . '%');
$query->where('(a.entranslation LIKE '.$search.')'); $query->where('(a.source LIKE '.$search.')');
} }
} }
@ -386,11 +386,11 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// load the languages to the string // load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket)) if (ComponentbuilderHelper::checkArray($langBucket))
{ {
$item->entranslation = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150) . $componentCounter; $item->source = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
} }
else else
{ {
$item->entranslation = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150) . $componentCounter; $item->source = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
} }
} }
} }
@ -420,7 +420,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{ {
$item->{$lanTag} = ''; $item->{$lanTag} = '';
} }
// now adapt the entranslation // now adapt the source
if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation)) if (isset($item->translation) && ComponentbuilderHelper::checkJson($item->translation))
{ {
$translations = json_decode($item->translation, true); $translations = json_decode($item->translation, true);
@ -458,7 +458,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// start setup of headers // start setup of headers
$headers = new stdClass(); $headers = new stdClass();
$headers->id = 'id'; $headers->id = 'id';
$headers->English = 'English'; $headers->Source = 'Source';
// add the languages // add the languages
if (ComponentbuilderHelper::checkArray($languages)) if (ComponentbuilderHelper::checkArray($languages))
{ {
@ -485,7 +485,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
$id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.entranslation'); $id .= ':' . $this->getState('filter.source');
return parent::getStoreId($id); return parent::getStoreId($id);
} }

View File

@ -774,7 +774,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` (
`id` INT(11) NOT NULL AUTO_INCREMENT, `id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`components` TEXT NOT NULL, `components` TEXT NOT NULL,
`entranslation` TEXT NOT NULL, `source` TEXT NOT NULL,
`translation` TEXT NOT NULL, `translation` TEXT NOT NULL,
`params` text NOT NULL DEFAULT '', `params` text NOT NULL DEFAULT '',
`published` TINYINT(3) NOT NULL DEFAULT 1, `published` TINYINT(3) NOT NULL DEFAULT 1,

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_language_translation` CHANGE `entranslation` `source` TEXT NOT NULL;

View File

@ -77,13 +77,13 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
<td class="nowrap"> <td class="nowrap">
<?php if ($canDo->get('language_translation.edit')): ?> <?php if ($canDo->get('language_translation.edit')): ?>
<div class="name"> <div class="name">
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $item->entranslation; ?></a> <a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $item->source; ?></a>
<?php if ($item->checked_out): ?> <?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> <?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'language_translations.', $canCheckin); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="name"><?php echo $item->entranslation; ?></div> <div class="name"><?php echo $item->source; ?></div>
<?php endif; ?> <?php endif; ?>
</td> </td>
<td class="center"> <td class="center">

View File

@ -44,7 +44,7 @@ defined('_JEXEC') or die('Restricted access');
</th> </th>
<?php endif; ?> <?php endif; ?>
<th class="nowrap" > <th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL', 'entranslation', $this->listDirn, $this->listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_LABEL', 'source', $this->listDirn, $this->listOrder); ?>
</th> </th>
<?php if ($this->canState): ?> <?php if ($this->canState): ?>
<th width="10" class="nowrap center" > <th width="10" class="nowrap center" >

View File

@ -245,7 +245,7 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy
return array( return array(
'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'), 'a.published' => JText::_('JSTATUS'),
'a.entranslation' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL'), 'a.source' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID') 'a.id' => JText::_('JGRID_HEADING_ID')
); );
} }

View File

@ -7,9 +7,9 @@
<authorUrl>http://joomlacomponentbuilder.com</authorUrl> <authorUrl>http://joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright> <copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license> <license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.7.5</version> <version>2.7.6</version>
<description><![CDATA[ <description><![CDATA[
<h1>Component Builder (v.2.7.5)</h1> <h1>Component Builder (v.2.7.6)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. <p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -339,4 +339,21 @@
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl> <maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/> <targetplatform name="joomla" version="3.*"/>
</update> </update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.7.6</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.7.6/JCB_v2.7.6.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates> </updates>

View File

@ -3476,7 +3476,7 @@ class com_componentbuilderInstallerScript
$language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation';
$language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "entranslation","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"entranslation":"entranslation","components":"components"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","components":"components"}}';
$language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute';
$language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
@ -4153,7 +4153,7 @@ class com_componentbuilderInstallerScript
$language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation';
$language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "entranslation","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"entranslation":"entranslation","components":"components"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","components":"components"}}';
$language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute';
$language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
@ -4878,7 +4878,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder"> echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/> <img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 2.7.5 Was Successful! Let us know if anything is not working as expected.</h3>'; <h3>Upgrade to Version 2.7.6 Was Successful! Let us know if anything is not working as expected.</h3>';
} }
} }