Stable release of v2.0.10

Adds better translation selection by Language.
This commit is contained in:
Robot 2023-08-03 06:40:07 +02:00
parent e14b888e28
commit 79802b059a
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
11 changed files with 146 additions and 40 deletions

View File

@ -53,4 +53,8 @@
- Adds update tags on front-end.
- Adds delete of tags on front-end.
- Improves verse view in note, and tag modal.
- Other bug fixes.
- Other bug fixes.
# v2.0.10
- Adds better translation selection by Language

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.9)
# Get Bible (2.0.10)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -18,8 +18,8 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 2nd August, 2023
+ *Version*: 2.0.9
+ *Last Build*: 3rd August, 2023
+ *Version*: 2.0.10
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -31,11 +31,11 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **195918**
+ *File count*: **1700**
+ *Line count*: **196024**
+ *File count*: **1701**
+ *Folder count*: **162**
**360 Hours** or **45 Eight Hour Days** (the actual time the author spent)
**361 Hours** or **46 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @137hours** = codingtime / 4;
@ -43,13 +43,13 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> **mapping @55hours** = codingtime / 10;
> **office @91hours** = codingtime / 6;)
**907 Hours** or **113 Eight Hour Days**
**908 Hours** or **114 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **22.6 weeks** or **4.7 months**
Project duration: **22.8 weeks** or **4.8 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.9)
# Get Bible (2.0.10)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -18,8 +18,8 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 2nd August, 2023
+ *Version*: 2.0.9
+ *Last Build*: 3rd August, 2023
+ *Version*: 2.0.10
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -31,11 +31,11 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **195918**
+ *File count*: **1700**
+ *Line count*: **196024**
+ *File count*: **1701**
+ *Folder count*: **162**
**360 Hours** or **45 Eight Hour Days** (the actual time the author spent)
**361 Hours** or **46 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @137hours** = codingtime / 4;
@ -43,13 +43,13 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> **mapping @55hours** = codingtime / 10;
> **office @91hours** = codingtime / 6;)
**907 Hours** or **113 Eight Hour Days**
**908 Hours** or **114 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **22.6 weeks** or **4.7 months**
Project duration: **22.8 weeks** or **4.8 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

View File

@ -0,0 +1 @@

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_GETBIBLE</name>
<creationDate>2nd August, 2023</creationDate>
<creationDate>3rd August, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://getbible.net</authorUrl>
<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>
<version>2.0.9</version>
<version>2.0.10</version>
<description><![CDATA[
<h1>Get Bible (v.2.0.9)</h1>
<h1>Get Bible (v.2.0.10)</h1>
<div style="clear: both;"></div>
<p>Welcome to the next level of scripture engagement - The Bible for Joomla! Our purpose is to bring the Word of God to every person, in their native language, entirely free. This isn't just a typical extension; it's a groundbreaking tool developed to span language divides and deliver a rich, customizable Bible study experience to users worldwide.

View File

@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript
echo '<a target="_blank" href="https://getbible.net" title="Get Bible">
<img src="components/com_getbible/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.0.9 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.0.10 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -484,8 +484,8 @@ class GetbibleModelApp extends ItemModel
// Get from #__getbible_translation as a
$query->select($db->quoteName(
array('a.id','a.language','a.lang','a.translation','a.abbreviation'),
array('id','language','lang','translation','abbreviation')));
array('a.id','a.language','a.lang','a.translation','a.abbreviation','a.distribution_lcsh'),
array('id','language','lang','translation','abbreviation','lcsh')));
$query->from($db->quoteName('#__getbible_translation', 'a'));
// Get where a.published is 1
$query->where('a.published = 1');

View File

@ -178,8 +178,8 @@ class GetbibleModelSearch extends ListModel
// Get from #__getbible_translation as a
$query->select($db->quoteName(
array('a.id','a.language','a.lang','a.translation','a.abbreviation'),
array('id','language','lang','translation','abbreviation')));
array('a.id','a.language','a.lang','a.translation','a.abbreviation','a.distribution_lcsh'),
array('id','language','lang','translation','abbreviation','lcsh')));
$query->from($db->quoteName('#__getbible_translation', 'a'));
// Get where a.published is 1
$query->where('a.published = 1');

View File

@ -19,20 +19,38 @@
defined('_JEXEC') or die('Restricted access');
?>
<div class="uk-child-width-auto uk-grid-small" uk-grid>
<?php foreach ($this->translations as $translation): ?>
<div>
<div class="uk-card">
<?php if ($translation->abbreviation !== $this->chapter->abbreviation): ?>
<a class="uk-button uk-button-default uk-button-small" href="<?php echo JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>">
<?php echo $translation->translation; ?> (<?php echo $translation->abbreviation; ?>)
</a>
<?php else: ?>
<a class="uk-button uk-button-default uk-button-small uk-active" href="<?php echo JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>">
<?php echo $translation->translation; ?> (<?php echo $translation->abbreviation; ?>)
</a>
<?php endif; ?>
<?php if (!empty($this->defaultTranslation)): ?>
<a class="uk-button uk-button-default uk-button-small uk-width-1-1" href="<?php echo JRoute::_('index.php?option=com_getbible&view=app&t=' . $this->defaultTranslation->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>">
<?php echo $this->defaultTranslation->translation; ?> (<?php echo $this->defaultTranslation->abbreviation; ?>)
</a>
<?php endif; ?>
<ul uk-accordion>
<?php foreach ($this->languages as $language => $translations): ?>
<?php if ($this->activeLanguage === $language): ?>
<li class="uk-open">
<?php else: ?>
<li>
<?php endif; ?>
<a class="uk-accordion-title" href="#"><?php echo $language; ?></a>
<div class="uk-accordion-content">
<?php foreach ($translations as $translation): ?>
<div class="uk-child-width-auto uk-grid-small" uk-grid>
<div>
<div class="uk-card">
<?php if ($translation->abbreviation !== $this->chapter->abbreviation): ?>
<a class="uk-button uk-button-default uk-button-small" href="<?php echo JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>">
<?php echo $translation->translation; ?> (<?php echo $translation->abbreviation; ?>)
</a>
<?php else: ?>
<a class="uk-button uk-button-default uk-button-small uk-active" href="<?php echo JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>">
<?php echo $translation->translation; ?> (<?php echo $translation->abbreviation; ?>)
</a>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</li>
<?php endforeach; ?>
</div>
</ul>

View File

@ -118,7 +118,10 @@ class GetbibleViewApp extends HtmlView
if ($this->params->get('show_install_button') == 1)
{
$this->totalVerse = Factory::_('GetBible.Watcher')->totalVerses($this->translation->abbreviation ?? 'kjv');
}
}
// sort translations
$this->setTranslations();
// Set the toolbar
$this->addToolBar();
@ -391,6 +394,68 @@ class GetbibleViewApp extends HtmlView
}
}
/**
* Sort the Translations by Language
*
* @return void
* @since 2.0.1
*/
protected function setTranslations(): void
{
if ($this->translations)
{
$default = $this->params->get('default_translation', 'kjv');
$bucket = [];
foreach ($this->translations as $translation)
{
// get language name as key
if (!empty($translation->language))
{
$lang = $translation->language;
}
elseif ($translation->lang === 'mlf')
{
$lang = 'Malayalam';
}
else
{
$lang = trim(preg_replace('/Bible\.?/', '', $translation->lcsh));
}
$bucket[$lang][$translation->translation] = $translation;
// set the active language
if ($translation->abbreviation === $this->chapter->abbreviation)
{
$this->activeLanguage = $lang;
}
// set the default translation
elseif ($translation->abbreviation === $default)
{
$this->defaultTranslation = $translation;
}
}
// Sort $bucket multidimensional array
foreach($bucket as $language => $translations)
{
// Sort translations for each language
uksort($translations, function($a, $b) {
// using strcmp for comparison
return strcmp($a, $b);
});
// Replace the original translations array with the sorted one
$bucket[$language] = $translations;
}
// Sort languages
uksort($bucket, function($a, $b) {
return strcmp($a, $b);
});
$this->languages = $bucket;
}
}
/**
* Set the daily verse url
*

View File

@ -161,4 +161,22 @@
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Get Bible</name>
<description>The Bible for Joomla</description>
<element>pkg_getbible</element>
<type>package</type>
<client>site</client>
<version>2.0.10</version>
<infourl title="Get Bible!">https://getbible.net</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.10.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>