From 79802b059adb780c5d0400164bd2c321fa633f31 Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 3 Aug 2023 06:40:07 +0200 Subject: [PATCH] Stable release of v2.0.10 Adds better translation selection by Language. --- CHANGELOG.md | 6 +- README.md | 16 ++--- admin/README.txt | 16 ++--- admin/sql/updates/mysql/2.0.9.sql | 1 + getbible.xml | 6 +- script.php | 2 +- site/models/app.php | 4 +- site/models/search.php | 4 +- .../app/tmpl/default_getbibletranslations.php | 46 +++++++++---- site/views/app/view.html.php | 67 ++++++++++++++++++- update_server.xml | 18 +++++ 11 files changed, 146 insertions(+), 40 deletions(-) create mode 100644 admin/sql/updates/mysql/2.0.9.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index ef9f109..8186f40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. \ No newline at end of file +- Other bug fixes. + +# v2.0.10 + +- Adds better translation selection by Language \ No newline at end of file diff --git a/README.md b/README.md index 58656bc..42ad455 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/admin/README.txt b/admin/README.txt index 58656bc..42ad455 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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) diff --git a/admin/sql/updates/mysql/2.0.9.sql b/admin/sql/updates/mysql/2.0.9.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/admin/sql/updates/mysql/2.0.9.sql @@ -0,0 +1 @@ + diff --git a/getbible.xml b/getbible.xml index 5db670c..cae8e9f 100644 --- a/getbible.xml +++ b/getbible.xml @@ -1,15 +1,15 @@ COM_GETBIBLE - 2nd August, 2023 + 3rd August, 2023 Llewellyn van der Merwe joomla@vdm.io https://getbible.net Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.0.9 + 2.0.10 Get Bible (v.2.0.9) +

Get Bible (v.2.0.10)

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. diff --git a/script.php b/script.php index a84bbb0..6116e49 100644 --- a/script.php +++ b/script.php @@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript echo ' -

Upgrade to Version 2.0.9 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.0.10 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/models/app.php b/site/models/app.php index 590dd41..fd96595 100644 --- a/site/models/app.php +++ b/site/models/app.php @@ -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'); diff --git a/site/models/search.php b/site/models/search.php index 8075b39..379a0aa 100644 --- a/site/models/search.php +++ b/site/models/search.php @@ -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'); diff --git a/site/views/app/tmpl/default_getbibletranslations.php b/site/views/app/tmpl/default_getbibletranslations.php index 0cb88b5..265a412 100644 --- a/site/views/app/tmpl/default_getbibletranslations.php +++ b/site/views/app/tmpl/default_getbibletranslations.php @@ -19,20 +19,38 @@ defined('_JEXEC') or die('Restricted access'); ?> -
- translations as $translation): ?> -
-
- abbreviation !== $this->chapter->abbreviation): ?> - - translation; ?> (abbreviation; ?>) - - - - translation; ?> (abbreviation; ?>) - - +defaultTranslation)): ?> + + defaultTranslation->translation; ?> (defaultTranslation->abbreviation; ?>) + + +
+ diff --git a/site/views/app/view.html.php b/site/views/app/view.html.php index 61aee53..39d1286 100644 --- a/site/views/app/view.html.php +++ b/site/views/app/view.html.php @@ -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 * diff --git a/update_server.xml b/update_server.xml index 49871c6..f686d75 100644 --- a/update_server.xml +++ b/update_server.xml @@ -161,4 +161,22 @@ https://getbible.net + + Get Bible + The Bible for Joomla + pkg_getbible + package + site + 2.0.10 + https://getbible.net + + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.10.zip + + + stable + + Llewellyn van der Merwe + https://getbible.net + + \ No newline at end of file