Localized package infos stay localized after installation
authorMatthias Schmidt <gravatronics@live.com>
Fri, 2 Mar 2012 13:45:55 +0000 (14:45 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 4 Mar 2012 18:44:21 +0000 (19:44 +0100)
14 files changed:
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/templates/acpSessionLog.tpl
wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl
wcfsetup/install/files/acp/templates/packageListDetailed.tpl
wcfsetup/install/files/acp/templates/packageListPlugins.tpl
wcfsetup/install/files/acp/templates/packageUninstallationDependencies.tpl
wcfsetup/install/files/acp/templates/packageView.tpl
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/package/PackageArchive.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php

index 4af67e478562242935ca4883fe5e6f4aee946277..9ada6fc3deef79b4909055847025500dbd9da36a 100644 (file)
@@ -3,6 +3,7 @@
        <packageinformation>
                <packagename>WoltLab Community Framework</packagename>
                <packagedescription>Free web-framework, designed and developed for complex community applications.</packagedescription>
+               <packagedescription language="de">Freies Web-Framework, das für komplexe Community-Anwendungen entworfen und entwickelt wurde.</packagedescription>
                <isapplication>1</isapplication>
                <isunique>1</isunique>
                <version>2.0.0 Alpha 1</version> <!-- codename: maelstrom -->
index 95f3b5456ca2e164f359d4e9e635a5c8ccbbc0cd..a37b574c3c48030632ae00c734f356594e3311fd 100644 (file)
@@ -39,7 +39,7 @@
                                                        <td class="columnID columnSessionAccessLogID"><p>{@$sessionAccessLog->sessionAccessLogID}</p></td>
                                                        <td class="columnURL columnIpAddress"{if $sessionAccessLog->ipAddress != $sessionLog->ipAddress} style="color: red"{/if}><p>{$sessionAccessLog->ipAddress}</p></td>
                                                        <td class="columnDate columnTime"><p>{@$sessionAccessLog->time|time}</p></td>
-                                                       <td class="columnTitle columnPackageName"><p>{$sessionAccessLog->packageName}</p></td>
+                                                       <td class="columnTitle columnPackageName"><p>{$sessionAccessLog->packageName|language}</p></td>
                                                        <td class="columnText columnClassName"><p>{$sessionAccessLog->className}</p></td>
                                                        <td class="columnURL columnRequestURI" title="{$sessionAccessLog->requestURI}"><p>{if !$sessionAccessLog->hasProtectedURI()}<a href="{$sessionAccessLog->requestURI}{@SID_ARG_2ND}">{$sessionAccessLog->requestURI|truncate:50}</a>{else}{$sessionAccessLog->requestURI|truncate:50}{/if}</p></td>
                                                        <td class="columnTextolumnRequestMethod"><p>{$sessionAccessLog->requestMethod}</p></td>
index b55c4b5784ab51af39fd878f34acfd6a5b7253ad..1d2c354e139712338bb5eb21ed7f89a81e6061fa 100644 (file)
@@ -12,8 +12,8 @@
 <header class="wcf-container wcf-mainHeading">
        <img src="{@$__wcf->getPath()}icon/working1.svg" alt="" class="wcf-containerIcon" />
        <hgroup class="wcf-containerContent">
-               <h1>{$archive->getPackageInfo('packageName')}</h1>
-               <h2>{$archive->getPackageInfo('packageDescription')}</h2>
+               <h1>{$archive->getLocalizedPackageInfo('packageName')}</h1>
+               <h2>{$archive->getLocalizedPackageInfo('packageDescription')}</h2>
        </hgroup>
 </header>
 
index 2ab98150614ff4a8fefdb28424b44114673dcc72..423143c3e0f14b0652f5359256c54665fe3fe18e 100644 (file)
@@ -81,7 +81,7 @@
                                                                <img src="{@$__wcf->getPath()}icon/package1.svg" alt="" title="{lang}wcf.acp.package.type.other{/lang}" class="jsTooltip" />
                                                        {/if}
                                                </td>
-                                               <td id="packageName{@$package->packageID}" class="columnTitle" title="{$package->packageDescription}">
+                                               <td id="packageName{@$package->packageID}" class="columnTitle" title="{$package->packageDescription|language}">
                                                        <a href="{link controller='PackageView' id=$package->packageID}{/link}"><span>{$package->getName()}{if $package->instanceNo > 1 && $package->instanceName == ''} (#{#$package->instanceNo}){/if}</span></a>
                                                </td>
                                                <td class="columnText"><p>{if $package->authorURL}<a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$package->authorURL|rawurlencode}" class="wcf-externalURL">{$package->author}</a>{else}{$package->author}{/if}</p></td>
index 09048fac871e062d12ca17c1ceebede9259cda2e..d374d736fdfb3a63d598c0d576fb91e1764a2fcd 100644 (file)
@@ -3,7 +3,7 @@
                <div>
                        <a href="{link controller='PackageView' id=$packageID}{/link}" title="{$package->getName()}" style="background-image: url('{@$__wcf->getPath()}icon/packagePlugin1.svg');">
                                <h1>{$package->getName()}</h1>
-                               <small>{$package->packageDescription|truncate:150}</small>
+                               <small>{$package->packageDescription|language|truncate:150}</small>
                        </a>
                </div>
                
index f3690a938d7f95b2ec77bc2cd772305bfad320c2..5babddce45bbc0a51090e4619699e07eccb151ab 100644 (file)
@@ -12,7 +12,7 @@
        <img src="{@$__wcf->getPath()}icon/delete1.svg" alt="" class="wcf-containerIcon" />
        <hgroup class="wcf-containerContent">
                <h1>{lang}wcf.acp.package.uninstall{/lang}: {$packageObj->getName()}</h1>
-               <h2>{$packageObj->packageDescription}</h2>
+               <h2>{$packageObj->packageDescription|language}</h2>
        </hgroup>
 </header>
 
                                                        <img src="{@$__wcf->getPath()}icon/package1.svg" alt="" title="{lang}wcf.acp.package.list.other{/lang}" class="jsTooltip" />
                                                {/if}
                                        </td>
-                                       <td class="columnTitle" title="{$package.packageDescription}"><p><a href="{link controller='PackageView' id=$package.packageID}{/link}">{$package.packageName}{if $package.instanceNo > 1 && $package.instanceName == ''} (#{#$package.instanceNo}){/if}</a></p></td>
+                                       <td class="columnTitle" title="{$package.packageDescription|language}"><p><a href="{link controller='PackageView' id=$package.packageID}{/link}">{$package.packageName|language}{if $package.instanceNo > 1 && $package.instanceName == ''} (#{#$package.instanceNo}){/if}</a></p></td>
                                        <td class="columnText"><p>{if $package.authorURL}<a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$package.authorURL|rawurlencode}" class="wcf-externalURL">{$package.author}</a>{else}{$package.author}{/if}</p></td>
                                        <td class="columnText"><p>{$package.packageVersion}</p></td>
                                        <td class="columnDate"><p>{@$package.packageDate|date}</p></td>
index beab616587302ae8804f532fa72845ecff6ac689..d66141cc0cac44f988c232d12a3aa8075edab138 100644 (file)
@@ -12,7 +12,7 @@
        <img src="{@$__wcf->getPath()}icon/packageApplication1.svg" alt="" class="wcf-containerIcon" /><!-- ToDo: Add possibility to show a custom app icon if given! -->
        <hgroup class="wcf-containerContent">
                <h1>{$package->getName()}</h1>
-               <h2>{$package->packageDescription}</h2>
+               <h2>{$package->packageDescription|language}</h2>
        </hgroup>
 </header>
 
                        {event name='propertyFields'}
                </fieldset>
 
-               {if $package->packageDescription}
+               {if $package->packageDescription|language}
                        <hgroup class="wcf-subHeading">
                                <h1>{lang}wcf.acp.package.description{/lang}</h1>
                        </hgroup>
 
-                       <p>{$package->packageDescription}</p>
+                       <p>{$package->packageDescription|language}</p>
                {/if}
        </div>
 
                                                                                                <img src="{@$__wcf->getPath()}icon/package1.svg" alt="" title="{lang}wcf.acp.package.type.other{/lang}" class="jsTooltip" />
                                                                                        {/if}
                                                                                </td>
+<<<<<<< HEAD
                                                                                <td class="columnTitle" title="{$requiredPackage->packageDescription}"><p><a href="{link controller='PackageView' id=$requiredPackage->packageID}{/link}">{$requiredPackage->packageName}{if $requiredPackage->instanceNo > 1 && $requiredPackage->instanceName == ''} (#{#$requiredPackage->instanceNo}){/if}</a></p></td>
                                                                                <td class="columnText">{if $requiredPackage->authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$requiredPackage->authorURL|rawurlencode}" class="wcf-externalURL">{$requiredPackage->author}</a>{else}{$requiredPackage->author}</p>{/if}</td>
                                                                                <td class="columnText"><p>{$requiredPackage->packageVersion}</p></td>
                                                                                <td class="columnDate"><p>{@$requiredPackage->packageDate|date}</p></td>
+=======
+                                                                               <td class="columnTitle" title="{$requiredPackage.packageDescription|language}"><p><a href="{link controller='PackageView' id=$requiredPackage.packageID}{/link}">{$requiredPackage.packageName|language}{if $requiredPackage.instanceNo > 1 && $requiredPackage.instanceName == ''} (#{#$requiredPackage.instanceNo}){/if}</a></p></td>
+                                                                               <td class="columnText">{if $requiredPackage.authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$requiredPackage.authorURL|rawurlencode}" class="wcf-externalURL">{$requiredPackage.author}</a>{else}{$requiredPackage.author}</p>{/if}</td>
+                                                                               <td class="columnText"><p>{$requiredPackage.packageVersion}</p></td>
+                                                                               <td class="columnDate"><p>{@$requiredPackage.packageDate|date}</p></td>
+>>>>>>> Localized package infos stay localized after installation
                                                                                
                                                                                {event name='requirementColumns'}
                                                                        </tr>
                                                                                                <img src="{@$__wcf->getPath()}icon/package1.svg" alt="" title="{lang}wcf.acp.package.type.other{/lang}" class="jsTooltip" />
                                                                                        {/if}
                                                                                </td>
-                                                                               <td class="columnTitle" title="{$dependentPackage->packageDescription}"><p><a href="{link controller='PackageView' id=$dependentPackage->packageID}{/link}">{$dependentPackage->packageName}{if $dependentPackage->instanceNo > 1 && $dependentPackage->instanceName == ''} (#{#$dependentPackage->instanceNo}){/if}</a></p></td>
-                                                                               <td class="columnText">{if $dependentPackage->authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$dependentPackage->authorURL|rawurlencode}" class="wcf-externalURL">{$dependentPackage->author}</a>{else}{$dependentPackage->author}</p>{/if}</td>
+                                                                               <td class="columnTitle" title="{$dependentPackage->packageDescription|language}"><p><a href="{link controller='PackageView' id=$dependentPackage->packageID}{/link}">{$dependentPackage->packageName|language}{if $dependentPackage->instanceNo > 1 && $dependentPackage->instanceName == ''} (#{#$dependentPackage->instanceNo}){/if}</a></p></td>
+                                                                               <td class="columnText">{if $dependentPackage->authorURL}<p><a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$dependentPackage.authorURL|rawurlencode}" class="wcf-externalURL">{$dependentPackage->author}</a>{else}{$dependentPackage->author}</p>{/if}</td>
                                                                                <td class="columnText"><p>{$dependentPackage->packageVersion}</p></td>
                                                                                <td class="columnDate"><p>{@$dependentPackage->packageDate|date}</p></td>
                                                                                
index 5fac5d04b8f6038bc632e5dfa804c3c3dccd0f99..f9f53937a36d031e56484f14c8b481a1025e3f4e 100755 (executable)
@@ -221,7 +221,7 @@ class PackageStartInstallForm extends ACPForm {
                        'processNo' => $processNo,
                        'userID' => WCF::getUser()->userID,
                        'package' => $this->archive->getPackageInfo('name'),
-                       'packageName' => $this->archive->getPackageInfo('packageName'),
+                       'packageName' => $this->archive->getLocalizedPackageInfo('packageName'),
                        'packageID' => $packageID,
                        'archive' => (!empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage),
                        'action' => ($this->package != null ? 'update' : 'install'),
index dd1ddb58b7092a616f7770009aa877a31c8ae2b3..1849e312514bcc5971a979c283b5ccce64f6293f 100644 (file)
@@ -87,7 +87,7 @@ class Package extends DatabaseObject {
         * @return      string
         */
        public function getName() {
-               return ($this->instanceName ? $this->instanceName : $this->packageName);
+               return WCF::getLanguage()->get($this->instanceName ? $this->instanceName : $this->packageName);
        }
        
        /**
index df27e792e34be2d44e59f8b20afc18bac62a31bc..f4ff2638a46519cab5ddb09ba18c51b3a749f549 100644 (file)
@@ -1046,7 +1046,7 @@ class WCFSetup extends WCF {
                                'processNo' => $processNo,
                                'userID' => $admin->userID,
                                'package' => $packageName,
-                               'packageName' => $archive->getPackageInfo('packageName'),
+                               'packageName' => $archive->getLocalizedPackageInfo('packageName'),
                                'archive' => TMP_DIR.'install/packages/'.$packageFile
                        ));
                }
@@ -1107,7 +1107,7 @@ class WCFSetup extends WCF {
                                        try {
                                                $archive = new PackageArchive(TMP_DIR.'install/packages/'.$packageFile);
                                                $archive->openArchive();
-                                               self::$setupPackageName = $archive->getPackageInfo('packageName');
+                                               self::$setupPackageName = $archive->getLocalizedPackageInfo('packageName');
                                                $archive->getTar()->close();
                                                break;
                                        }
index 7be3c9a43335435bbf3ae2b6fd6852c895e7faad..ca56bf10b7eae4bb97c3ee0d460faae522e3b1fc 100644 (file)
@@ -380,47 +380,12 @@ class PackageArchive {
                if (!isset($this->packageInfo['plugin'])) $this->packageInfo['plugin'] = '';
                if (!isset($this->packageInfo['packageURL'])) $this->packageInfo['packageURL'] = '';
                
-               // get package name in selected language
-               $this->getLocalizedInformation('packageName');
-               
-               // get package description in selected language
-               if (isset($this->packageInfo['packageDescription'])) {
-                       $this->getLocalizedInformation('packageDescription');
-               }
-               
-               // get package license in selected language
-               if (isset($this->packageInfo['license'])) {
-                       $this->getLocalizedInformation('license');
-               }
-               
-               // get package information in selected language
-               if (isset($this->packageInfo['readme'])) {
-                       $this->getLocalizedInformation('readme');
-               }
-               
                // add plugin to requirements
                if ($this->packageInfo['plugin'] && !isset($this->requirements[$this->packageInfo['plugin']])) {
                        $this->requirements[$this->packageInfo['plugin']] = array('name' => $this->packageInfo['plugin']);
                }
        }
        
-       /**
-        * Gets localized package information strings.
-        * 
-        * @param       string          $key
-        */
-       protected function getLocalizedInformation($key) {
-               if (isset($this->packageInfo[$key][WCF::getLanguage()->getFixedLanguageCode()])) {
-                       $this->packageInfo[$key] = $this->packageInfo[$key][WCF::getLanguage()->getFixedLanguageCode()];
-               }
-               else if (isset($this->packageInfo[$key]['default'])) {
-                       $this->packageInfo[$key] = $this->packageInfo[$key]['default'];
-               }
-               else {
-                       $this->packageInfo[$key] = array_shift($this->packageInfo[$key]);
-               }
-       }
-       
        /**
         * Downloads the package archive.
         * 
@@ -583,6 +548,23 @@ class PackageArchive {
                return null;
        }
        
+       /**
+        * Returns a localized information about this package.
+        * 
+        * @param       string          $name
+        * @return      mixed
+        */
+       public function getLocalizedPackageInfo($name) {
+               if (isset($this->packageInfo[$name][WCF::getLanguage()->getFixedLanguageCode()])) {
+                       return $this->packageInfo[$name][WCF::getLanguage()->getFixedLanguageCode()];
+               }
+               else if (isset($this->packageInfo[$name]['default'])) {
+                       return $this->packageInfo[$name]['default'];
+               }
+               
+               return $this->getPackageInfo($name);
+       }
+       
        /**
         * Returns a list of all requirements of this package.
         * 
index 106bbc0250ea1b6c436cbff921ae0b7989c6e8a3..eb2c7bc2b9361fbe6ba94a5eb61900af63f05596 100644 (file)
@@ -2,18 +2,22 @@
 namespace wcf\system\package;
 use wcf\data\application\Application;
 use wcf\data\application\ApplicationEditor;
+use wcf\data\language\category\LanguageCategory;
 use wcf\data\language\LanguageEditor;
+use wcf\data\language\LanguageList;
 use wcf\data\option\OptionEditor;
 use wcf\data\package\installation\queue\PackageInstallationQueue;
 use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
 use wcf\data\package\Package;
 use wcf\data\package\PackageEditor;
 use wcf\system\cache\CacheHandler;
+use wcf\system\database\statement\PreparedStatement;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\SystemException;
 use wcf\system\form\container;
 use wcf\system\form\element;
 use wcf\system\form\FormDocument;
+use wcf\system\language\LanguageFactory;
 use wcf\system\menu\acp\ACPMenu;
 use wcf\system\request\LinkHandler;
 use wcf\system\request\RouteHandler;
@@ -207,6 +211,39 @@ class PackageInstallationDispatcher {
                        // create package entry
                        $package = PackageEditor::create($nodeData);
                        
+                       // localize package information
+                       $sql = "INSERT INTO     wcf".WCF_N."_language_item
+                                               (languageID, languageItem, languageItemValue, languageCategoryID, packageID)
+                               VALUES          (?, ?, ?, ?, ?)";
+                       $statement = WCF::getDB()->prepareStatement($sql);
+                       
+                       // workaround for WCFSetup
+                       if (!PACKAGE_ID) {
+                               $sql = "SELECT  *
+                                       FROM    wcf".WCF_N."_language_category
+                                       WHERE   languageCategory = ?";
+                               $statement2 = WCF::getDB()->prepareStatement($sql);
+                               $statement2->execute(array('wcf.acp.package'));
+                               $languageCategory = $statement2->fetchObject('wcf\data\language\category\LanguageCategory');
+                       }
+                       else {
+                               $languageCategory = LanguageFactory::getInstance()->getCategory('wcf.acp.package');
+                       }
+                       
+                       // save package name
+                       $this->saveLocalizedPackageInfo($statement, $languageCategory, $package, 'packageName');
+                       
+                       // save package description
+                       $this->saveLocalizedPackageInfo($statement, $languageCategory, $package, 'packageDescription');
+                       
+                       // todo: license and readme
+                       
+                       $packageEditor = new PackageEditor($package);
+                       $packageEditor->update(array(
+                               'packageDescription' => 'wcf.acp.package.packageDescription.package'.$package->packageID,
+                               'packageName' => 'wcf.acp.package.packageName.package'.$package->packageID
+                       ));
+                       
                        // update package id for current queue
                        $queueEditor = new PackageInstallationQueueEditor($this->queue);
                        $queueEditor->update(array(
@@ -292,6 +329,62 @@ class PackageInstallationDispatcher {
                return $installationStep;
        }
        
+       /**
+        * Saves a localized package info.
+        * 
+        * @param       wcf\system\database\statement\PreparedStatement         $statement
+        * @param       wcf\data\language\category\LanguageCategory             $languageCategory
+        * @param       wcf\data\package\Package                                $package
+        * @param       string                                                  $infoName
+        */
+       protected function saveLocalizedPackageInfo(PreparedStatement $statement, LanguageCategory $languageCategory, Package $package, $infoName) {
+               $infoValues = $this->getArchive()->getPackageInfo($infoName);
+               
+               // get default value for languages without specified information
+               $defaultValue = '';
+               if (isset($infoValues['default'])) {
+                       $defaultValue = $infoValues['default'];
+               }
+               else if (isset($infoValues['en'])) {
+                       // fallback to English
+                       $defaultValue = $infoValues['en'];
+               }
+               else if (isset($infoValues[WCF::getLanguage()->getFixedLanguageCode()])) {
+                       // fallback to the language of the current user
+                       $defaultValue = $infoValues[WCF::getLanguage()->getFixedLanguageCode()];
+               }
+               else if ($infoName == 'packageName') {
+                       // fallback to the package identifier for the package name
+                       $defaultValue = $this->archive->getPackageInfo('name');
+               }
+               
+               // workaround for WCFSetup
+               if (!PACKAGE_ID) {
+                       $languageList = new LanguageList();
+                       $languageList->sqlLimit = 0;
+                       $languageList->readObjects();
+                       $languages = $languageList->getObjects();
+               }
+               else {
+                       $languages = LanguageFactory::getInstance()->getLanguages();
+               }
+               
+               foreach ($languages as $language) {
+                       $value = $defaultValue;
+                       if (isset($infoValues[$language->languageCode])) {
+                               $value = $infoValues[$language->languageCode];
+                       }
+               
+                       $statement->execute(array(
+                               $language->languageID,
+                               'wcf.acp.package.'.$infoName.'.package'.$package->packageID,
+                               $value,
+                               $languageCategory->languageCategoryID,
+                               1
+                       ));
+               }
+       }
+       
        /**
         * Sets parent package and rebuilds dependencies for both.
         */     
@@ -706,7 +799,7 @@ class PackageInstallationDispatcher {
                if (empty($this->queue->packageName)) {
                        $queueEditor = new PackageInstallationQueueEditor($this->queue);
                        $queueEditor->update(array(
-                               'packageName' => $this->getArchive()->getPackageInfo('packageName')
+                               'packageName' => $this->getArchive()->getLocalizedPackageInfo('packageName')
                        ));
                        
                        // reload queue
index 5592cfedd60ba9048a5a536f0eabf2e200c55823..ef3bafe78fe51070cbd11da37d29ed88207d352c 100644 (file)
@@ -393,9 +393,9 @@ class PackageInstallationNodeBuilder {
                        'package',
                        serialize(array(
                                'package' => $this->installation->getArchive()->getPackageInfo('name'),
-                               'packageName' => $this->installation->getArchive()->getPackageInfo('packageName'),
+                               'packageName' => $this->installation->getArchive()->getLocalizedPackageInfo('packageName'),
                                'instanceNo' => $instanceNo,
-                               'packageDescription' => $this->installation->getArchive()->getPackageInfo('packageDescription'),
+                               'packageDescription' => $this->installation->getArchive()->getLocalizedPackageInfo('packageDescription'),
                                'packageVersion' => $this->installation->getArchive()->getPackageInfo('version'),
                                'packageDate' => $this->installation->getArchive()->getPackageInfo('date'),
                                'packageURL' => $this->installation->getArchive()->getPackageInfo('packageURL'),
@@ -458,7 +458,7 @@ class PackageInstallationNodeBuilder {
                                'processNo' => $queue->processNo,
                                'userID' => WCF::getUser()->userID,
                                'package' => $archive->getPackageInfo('name'),
-                               'packageName' => $archive->getPackageInfo('packageName'),
+                               'packageName' => $archive->getLocalizedPackageInfo('packageName'),
                                'archive' => $fileName,
                                'action' => $queue->action
                        ));
@@ -561,7 +561,7 @@ class PackageInstallationNodeBuilder {
                        $packages[] = array(
                                'archive' => $fileName,
                                'package' => $archive->getPackageInfo('name'),
-                               'packageName' => $archive->getPackageInfo('packageName'),
+                               'packageName' => $archive->getLocalizedPackageInfo('packageName'),
                                'selected' => 0
                        );
                }
index 08478aad3fd8839afaba2ffb15383d4f385e3a07..7831e55c5d449e4eb9dd7e6455dfb30951048151 100644 (file)
@@ -91,6 +91,16 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
        protected function uninstallPackage(array $nodeData) {
                PackageEditor::deleteAll(array($this->queue->packageID));
                
+               // remove localized package infos
+               // todo: license/readme
+               $sql = "DELETE FROM     wcf".WCF_N."_language_item
+                       WHERE           languageItem IN (?, ?)";
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute(array(
+                       'wcf.acp.package.packageName.package'.$this->queue->packageID,
+                       'wcf.acp.package.packageDescription.package'.$this->queue->packageID
+               ));
+               
                // reset package cache
                CacheHandler::getInstance()->clearResource('packages');