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

Public Member Functions

 __construct (protected readonly EventDispatcherInterface $eventDispatcher, protected readonly RequestFactory $requestFactory, protected readonly LoggerInterface $logger)
 
array getAvailableLanguages ()
 
list< non-empty-string > getActiveLanguages ()
 
 getLanguageDetails ()
 
 getExtensionLanguagePackDetails ()
 
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
 

Private Attributes

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 42 of file LanguagePackService.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 54 of file LanguagePackService.php.

Member Function Documentation

◆ getActiveLanguages()

list<non-empty-string> 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 68 of file LanguagePackService.php.

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

◆ 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 284 of file LanguagePackService.php.

References $GLOBALS.

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

◆ getLanguageDetails()

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

◆ 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 267 of file LanguagePackService.php.

References $GLOBALS.

◆ 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 300 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().

Member Data Documentation

◆ $locales

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

Definition at line 46 of file LanguagePackService.php.

◆ $registry

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

Definition at line 50 of file LanguagePackService.php.

◆ LANGUAGE_PACK_URL

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