TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Lang\Service\UpdateTranslationService Class Reference

Public Member Functions

 updateTranslation ($extension, $locales)
 

Public Attributes

const TRANSLATION_NOT_AVAILABLE = 0
 
const TRANSLATION_AVAILABLE = 1
 
const TRANSLATION_FAILED = 2
 
const TRANSLATION_OK = 3
 
const TRANSLATION_INVALID = 4
 
const TRANSLATION_UPDATED = 5
 

Protected Member Functions

 getTranslationStateForExtension ($extensionKey, $locale)
 
 getTranslationFileMd5 ($extensionKey, $locale)
 
 updateTranslationForExtension ($extensionKey, $locale)
 
 getMirrorUrl ($extensionKey)
 
 emitPostProcessMirrorUrlSignal ($extensionKey, $mirrorUrl)
 

Protected Attributes

 $languageRepository
 
 $repositoryHelper
 
 $terConnection
 
 $signalSlotDispatcher
 
 $translationStates = array()
 

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! Update languages service

Definition at line 20 of file UpdateTranslationService.php.

Member Function Documentation

◆ emitPostProcessMirrorUrlSignal()

TYPO3\CMS\Lang\Service\UpdateTranslationService::emitPostProcessMirrorUrlSignal (   $extensionKey,
  $mirrorUrl 
)
protected

Emits a signal after the mirror URL of an extension was fetched

Parameters
string$extensionKey
string$mirrorUrl
Returns
string Modified mirror url

Definition at line 200 of file UpdateTranslationService.php.

Referenced by TYPO3\CMS\Lang\Service\UpdateTranslationService\getMirrorUrl().

◆ getMirrorUrl()

TYPO3\CMS\Lang\Service\UpdateTranslationService::getMirrorUrl (   $extensionKey)
protected

◆ getTranslationFileMd5()

TYPO3\CMS\Lang\Service\UpdateTranslationService::getTranslationFileMd5 (   $extensionKey,
  $locale 
)
protected

Returns the md5 of a translation file

Parameters
string$extensionKeyThe extension key
string$localeThe locale
Returns
string The md5 value

Definition at line 146 of file UpdateTranslationService.php.

Referenced by TYPO3\CMS\Lang\Service\UpdateTranslationService\getTranslationStateForExtension().

◆ getTranslationStateForExtension()

TYPO3\CMS\Lang\Service\UpdateTranslationService::getTranslationStateForExtension (   $extensionKey,
  $locale 
)
protected

Returns the translation state for an extension

Parameters
string$extensionKeyThe extension key
string$localeLocale to return
Returns
integer Translation state

Definition at line 99 of file UpdateTranslationService.php.

References TYPO3\CMS\Lang\Service\UpdateTranslationService\getMirrorUrl(), and TYPO3\CMS\Lang\Service\UpdateTranslationService\getTranslationFileMd5().

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

◆ updateTranslation()

TYPO3\CMS\Lang\Service\UpdateTranslationService::updateTranslation (   $extension,
  $locales 
)

Update translation for given extension

Parameters
string$extensionThe extension key
string$localesComma separated list of locales to update
Returns
array

Definition at line 68 of file UpdateTranslationService.php.

References $locales, TYPO3\CMS\Lang\Service\UpdateTranslationService\getTranslationStateForExtension(), TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Lang\Service\UpdateTranslationService\updateTranslationForExtension().

◆ updateTranslationForExtension()

TYPO3\CMS\Lang\Service\UpdateTranslationService::updateTranslationForExtension (   $extensionKey,
  $locale 
)
protected

Update the translation for an extension

Parameters
string$extensionKeyThe extension key
string$localeLocale to update
Returns
integer Translation state

Definition at line 164 of file UpdateTranslationService.php.

References TYPO3\CMS\Lang\Service\UpdateTranslationService\getMirrorUrl().

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

Member Data Documentation

◆ $languageRepository

TYPO3\CMS\Lang\Service\UpdateTranslationService::$languageRepository
protected

Definition at line 36 of file UpdateTranslationService.php.

◆ $repositoryHelper

TYPO3\CMS\Lang\Service\UpdateTranslationService::$repositoryHelper
protected

Definition at line 42 of file UpdateTranslationService.php.

◆ $signalSlotDispatcher

TYPO3\CMS\Lang\Service\UpdateTranslationService::$signalSlotDispatcher
protected

Definition at line 54 of file UpdateTranslationService.php.

◆ $terConnection

TYPO3\CMS\Lang\Service\UpdateTranslationService::$terConnection
protected

Definition at line 48 of file UpdateTranslationService.php.

◆ $translationStates

TYPO3\CMS\Lang\Service\UpdateTranslationService::$translationStates = array()
protected

Definition at line 59 of file UpdateTranslationService.php.

◆ TRANSLATION_AVAILABLE

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_AVAILABLE = 1

Definition at line 26 of file UpdateTranslationService.php.

◆ TRANSLATION_FAILED

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_FAILED = 2

Definition at line 27 of file UpdateTranslationService.php.

◆ TRANSLATION_INVALID

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_INVALID = 4

Definition at line 29 of file UpdateTranslationService.php.

◆ TRANSLATION_NOT_AVAILABLE

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_NOT_AVAILABLE = 0

Status codes for AJAX response

Definition at line 25 of file UpdateTranslationService.php.

◆ TRANSLATION_OK

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_OK = 3

Definition at line 28 of file UpdateTranslationService.php.

◆ TRANSLATION_UPDATED

const TYPO3\CMS\Lang\Service\UpdateTranslationService::TRANSLATION_UPDATED = 5

Definition at line 30 of file UpdateTranslationService.php.