‪TYPO3CMS  10.4
TYPO3\CMS\Install\Service\LanguagePackService Class Reference

Public Member Functions

 __construct (EventDispatcherInterface $eventDispatcher, RequestFactory $requestFactory, LoggerInterface $logger)
 
array getAvailableLanguages ()
 
array getActiveLanguages ()
 
array getLanguageDetails ()
 
array getExtensionLanguagePackDetails ()
 
string updateMirrorBaseUrl ()
 
string languagePackDownload (string $key, string $iso)
 
 setLastUpdatedIsoCode (array $isos)
 

Protected Member Functions

string null getFormattedDate ($timestamp)
 
 unzipTranslationFile (string $file, string $path)
 

Protected Attributes

Locales $locales
 
Registry $registry
 
EventDispatcherInterface $eventDispatcher
 
RequestFactory $requestFactory
 
LoggerInterface $logger
 

Private Attributes

const OLD_LANGUAGE_PACK_URLS
 
const LANGUAGE_PACK_URL = 'https://localize.typo3.org/xliff/'
 

Detailed Description

Service class handling language pack details Used by 'manage language packs' module and 'language packs command'

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 41 of file LanguagePackService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\Service\LanguagePackService::__construct ( EventDispatcherInterface  $eventDispatcher,
RequestFactory  $requestFactory,
LoggerInterface  $logger 
)

Member Function Documentation

◆ getActiveLanguages()

array TYPO3\CMS\Install\Service\LanguagePackService::getActiveLanguages ( )

◆ getAvailableLanguages()

array TYPO3\CMS\Install\Service\LanguagePackService::getAvailableLanguages ( )

Get list of available languages

Returns
‪array iso=>name

Definition at line 88 of file LanguagePackService.php.

Referenced by TYPO3\CMS\Install\Service\LanguagePackService\getLanguageDetails(), and TYPO3\CMS\Install\Service\LanguagePackService\languagePackDownload().

◆ getExtensionLanguagePackDetails()

array TYPO3\CMS\Install\Service\LanguagePackService::getExtensionLanguagePackDetails ( )

◆ getFormattedDate()

string null TYPO3\CMS\Install\Service\LanguagePackService::getFormattedDate (   $timestamp)
protected

Format a timestamp to a formatted date string

Parameters
int | null$timestamp
Returns
‪string|null

Definition at line 364 of file LanguagePackService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Service\LanguagePackService\getExtensionLanguagePackDetails(), and TYPO3\CMS\Install\Service\LanguagePackService\getLanguageDetails().

◆ getLanguageDetails()

array TYPO3\CMS\Install\Service\LanguagePackService::getLanguageDetails ( )

Create an array with language details: active or not, iso codes, last update, ...

Returns
‪array

Definition at line 109 of file LanguagePackService.php.

References TYPO3\CMS\Install\Service\LanguagePackService\getActiveLanguages(), TYPO3\CMS\Install\Service\LanguagePackService\getAvailableLanguages(), and TYPO3\CMS\Install\Service\LanguagePackService\getFormattedDate().

◆ languagePackDownload()

◆ setLastUpdatedIsoCode()

TYPO3\CMS\Install\Service\LanguagePackService::setLastUpdatedIsoCode ( array  $isos)

Set 'last update' timestamp in registry for a series of iso codes.

Parameters
string[]$isos‪List of iso code timestamps to set
Exceptions

Definition at line 346 of file LanguagePackService.php.

References $GLOBALS, TYPO3\CMS\Install\Service\LanguagePackService\$registry, and TYPO3\CMS\Core\Registry\set().

◆ unzipTranslationFile()

TYPO3\CMS\Install\Service\LanguagePackService::unzipTranslationFile ( string  $file,
string  $path 
)
protected

Unzip a language zip file

Parameters
string$file‪path to zip file
string$path‪path to extract to

Definition at line 380 of file LanguagePackService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\fixPermissions(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep().

Referenced by TYPO3\CMS\Install\Service\LanguagePackService\languagePackDownload().

◆ updateMirrorBaseUrl()

string TYPO3\CMS\Install\Service\LanguagePackService::updateMirrorBaseUrl ( )

Update main language pack download location if possible. Store to registry to be used during language pack update

Returns
‪string

Definition at line 211 of file LanguagePackService.php.

References TYPO3\CMS\Install\Service\LanguagePackService\LANGUAGE_PACK_URL.

Member Data Documentation

◆ $eventDispatcher

EventDispatcherInterface TYPO3\CMS\Install\Service\LanguagePackService::$eventDispatcher
protected

◆ $locales

Locales TYPO3\CMS\Install\Service\LanguagePackService::$locales
protected

Definition at line 45 of file LanguagePackService.php.

◆ $logger

LoggerInterface TYPO3\CMS\Install\Service\LanguagePackService::$logger
protected

◆ $registry

Registry TYPO3\CMS\Install\Service\LanguagePackService::$registry
protected

◆ $requestFactory

RequestFactory TYPO3\CMS\Install\Service\LanguagePackService::$requestFactory
protected

◆ LANGUAGE_PACK_URL

const TYPO3\CMS\Install\Service\LanguagePackService::LANGUAGE_PACK_URL = 'https://localize.typo3.org/xliff/'
private

◆ OLD_LANGUAGE_PACK_URLS

const TYPO3\CMS\Install\Service\LanguagePackService::OLD_LANGUAGE_PACK_URLS
private
Initial value:
= [
'https:
'https:
'https:
]

Definition at line 59 of file LanguagePackService.php.