TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Lang\Utility\Connection\Ter Class Reference
Inheritance diagram for TYPO3\CMS\Lang\Utility\Connection\Ter:
TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility

Public Member Functions

 fetchTranslationStatus ($extensionKey, $mirrorUrl)
 
 updateTranslation ($extensionKey, $language, $mirrorUrl)
 
- Public Member Functions inherited from TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
 fetchExtension ($extensionKey, $version, $expectedMd5, $mirrorUrl)
 
 decodeServerData ($externalData)
 
 decodeExchangeData ($stream)
 

Protected Member Functions

 parseL10nXML ($string)
 
 fetchTranslation ($extensionKey, $language, $mirrorUrl)
 
 unzipTranslationFile ($file, $path)
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
 $wsdlUrl
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Extends of extensionmanager ter connection to enrich with translation related methods

Author
Sebastian Fischer typo3.nosp@m.@evo.nosp@m.web.d.nosp@m.e

Definition at line 21 of file Ter.php.

Member Function Documentation

◆ fetchTranslation()

TYPO3\CMS\Lang\Utility\Connection\Ter::fetchTranslation (   $extensionKey,
  $language,
  $mirrorUrl 
)
protected

Fetches an extensions l10n file from the given mirror

Parameters
string$extensionKeyExtension Key
string$languageThe language code of the translation to fetch
string$mirrorUrlURL of mirror to use
Exceptions

Definition at line 168 of file Ter.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\strtolower().

Referenced by TYPO3\CMS\Lang\Utility\Connection\Ter\updateTranslation().

◆ fetchTranslationStatus()

TYPO3\CMS\Lang\Utility\Connection\Ter::fetchTranslationStatus (   $extensionKey,
  $mirrorUrl 
)

Fetches extensions translation status

Parameters
string$extensionKeyExtension Key
string$mirrorUrlURL of mirror to use
Returns
mixed

Definition at line 30 of file Ter.php.

References $remote, $result, TYPO3\CMS\Lang\Utility\Connection\Ter\parseL10nXML(), and TYPO3\CMS\Core\Utility\GeneralUtility\strtolower().

◆ parseL10nXML()

TYPO3\CMS\Lang\Utility\Connection\Ter::parseL10nXML (   $string)
protected

Parses content of *-l10n.xml into a suitable array

Parameters
string$string,XML data to parse
Exceptions

Definition at line 51 of file Ter.php.

References $result.

Referenced by TYPO3\CMS\Lang\Utility\Connection\Ter\fetchTranslationStatus().

◆ unzipTranslationFile()

TYPO3\CMS\Lang\Utility\Connection\Ter::unzipTranslationFile (   $file,
  $path 
)
protected

Unzip an language.zip.

Parameters
string$filepath to zip file
string$pathpath to extract to
Exceptions

Definition at line 189 of file Ter.php.

References $result, TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Lang\Utility\Connection\Ter\updateTranslation().

◆ updateTranslation()

TYPO3\CMS\Lang\Utility\Connection\Ter::updateTranslation (   $extensionKey,
  $language,
  $mirrorUrl 
)

Install translations for all selected languages for an extension

Parameters
string$extensionKeyThe extension key to install the translations for
string$languageLanguage code of translation to fetch
string$mirrorUrlMirror URL to fetch data from
Returns
boolean TRUE on success, error string on fauilure

Definition at line 129 of file Ter.php.

References $result, TYPO3\CMS\Lang\Utility\Connection\Ter\fetchTranslation(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), TYPO3\CMS\Core\Utility\GeneralUtility\rmdir(), TYPO3\CMS\Lang\Utility\Connection\Ter\unzipTranslationFile(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().