TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Lang\Service\TerService Class Reference
Inheritance diagram for TYPO3\CMS\Lang\Service\TerService:
TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 fetchTranslationStatus ($extensionKey, $mirrorUrl)
 
 updateTranslation ($extensionKey, $language, $mirrorUrl)
 
- Public Member Functions inherited from TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
 injectConfigurationUtility (\TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility)
 
 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
 
- Protected Attributes inherited from TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
 $configurationUtility
 

Detailed Description

Extends of extensionmanager ter connection to enrich with translation related methods

Definition at line 24 of file TerService.php.

Member Function Documentation

◆ fetchTranslation()

TYPO3\CMS\Lang\Service\TerService::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 166 of file TerService.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath(), and TYPO3\CMS\Core\Utility\GeneralUtility\strtolower().

Referenced by TYPO3\CMS\Lang\Service\TerService\updateTranslation().

◆ fetchTranslationStatus()

TYPO3\CMS\Lang\Service\TerService::fetchTranslationStatus (   $extensionKey,
  $mirrorUrl 
)

Fetches extensions translation status

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

Definition at line 33 of file TerService.php.

References $remote, TYPO3\CMS\Lang\Service\TerService\parseL10nXML(), and TYPO3\CMS\Core\Utility\GeneralUtility\strtolower().

◆ parseL10nXML()

TYPO3\CMS\Lang\Service\TerService::parseL10nXML (   $string)
protected

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

Parameters
string$string,XML data to parse
Exceptions

Definition at line 53 of file TerService.php.

Referenced by TYPO3\CMS\Lang\Service\TerService\fetchTranslationStatus().

◆ unzipTranslationFile()

TYPO3\CMS\Lang\Service\TerService::unzipTranslationFile (   $file,
  $path 
)
protected

Unzip an language zip file

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

Definition at line 204 of file TerService.php.

References 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\Service\TerService\updateTranslation().

◆ updateTranslation()

TYPO3\CMS\Lang\Service\TerService::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
bool TRUE on success, error string on failure

Definition at line 127 of file TerService.php.

References TYPO3\CMS\Lang\Service\TerService\fetchTranslation(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), TYPO3\CMS\Core\Utility\GeneralUtility\rmdir(), TYPO3\CMS\Lang\Service\TerService\unzipTranslationFile(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFileToTypo3tempDir().