From c8a6fc2d808b3ea07d9da73f9756f2997f5fe75c Mon Sep 17 00:00:00 2001 From: Lahmizzar Muinela <lahmizzar@devxive.com> Date: Wed, 24 Apr 2013 14:20:53 -0400 Subject: [PATCH] updated spelling --- install.script.php | 29 ++++++++++++++++++----------- 1 files changed, 18 insertions(+), 11 deletions(-) diff --git a/install.script.php b/install.script.php index 3ef55cb..5e40173 100644 --- a/install.script.php +++ b/install.script.php @@ -12,6 +12,7 @@ class pkg_projectfork_languagesInstallerScript { protected $name = 'lang_pf4'; + protected $uncomplete_lang = array("cs-CZ", "da-DK", "fa-IR", "fi-FI", "pt-PT", "sk-SK", "zh-TW", "ru-PO"); public function uninstall($parent) { $languages = JFactory::getLanguage()->getKnownLanguages(); @@ -26,15 +27,17 @@ $app = JFactory::getApplication(); // Do not install if Projectfork 4 doesn't exist. -// if (!defined('PF_FRAMEWORK')) { -// $app->enqueueMessage(sprintf ( 'Projectfork %s has not been installed, aborting!', '4.x' ), 'notice'); -// return false; -// } + $table = JTable::getInstance('extension'); + $id = $table->find(array('type'=>'component', 'element'=>'com_projectfork')); + if(!$id) { + $app->enqueueMessage(sprintf ( 'Projectfork %s has not been installed, aborting!', '4.x' ), 'notice'); + return false; + } - // Check the installed version of PF4 and the translation, give hints and tipps to do everything right! + // TODO: Check installed version of PF4 and translations, give hints and tipps to do everything right! // Get list of languages to be installed. Only installs languages that are found in your system. - $source = $parent->getParent()->getPath('source').'/language'; + $source = $parent->getParent()->getPath('source').'/languages'; $languages = JFactory::getLanguage()->getKnownLanguages(); $files = $parent->manifest->files; @@ -42,16 +45,20 @@ $search = JFolder::folders($source, $language['tag']); // no .zip files use "folders" instead if (empty($search)) continue; - // Generate something like <file type="file" client="site" id="com_kunena_fi-FI">com_kunena_fi-FI_v2.0.0.zip</file> + // Generate something like <file type="file" id="lang_pf4_en-GB">en-GB</file> $file = $files->addChild('file', array_pop($search)); $file->addAttribute('type', 'file'); - $file->addAttribute('id', $this->name.'_'.$language['tag']); - echo sprintf('Installing language %s - %s ...', $language['tag'], $language['name']) . '<br />'; + $file->addAttribute('id', $this->name . '_' . $language['tag']); + echo sprintf('<b>Installing detected language:</b> %s - %s ...', $language['tag'], $language['name']); + if(in_array($language['tag'], $this->uncomplete_lang)) { + echo ' <span style="color: darkorange;">(This language is not full translated at this moment. Please visit our <a href="https://github.com/projectfork/Translations/wiki" target="_blank">Projectfork Translations - Project Site</a> for more Informations and how to contribute!)'; + } + echo '<br />'; } if (empty($files)) { // No packages to install: replace failure message with something that's more descriptive. - $app->enqueueMessage(sprintf ( 'Your site is English only. There\'s no need to install a Projectfork Language Pack!' ), 'notice'); + $app->enqueueMessage(sprintf ( 'Your site is English only. There\'s no need to install an other Projectfork Language! If you want to install a different language, you have to install a different core language first!' ), 'notice'); return false; } @@ -61,7 +68,7 @@ public function uninstallLanguage($tag, $name) { $table = JTable::getInstance('extension'); $id = $table->find(array('type'=>'file', 'element'=>"{$this->name}_{$tag}")); - if (!$id) return; + if(!$id) return; $installer = new JInstaller(); $installer->uninstall ( 'file', $id ); -- Gitblit v1.9.1