PHP Class Sulu\Bundle\TranslateBundle\Translate\Export

Afficher le fichier Open project: sulu/sulu Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Translator $translator, Symfony\Component\Console\Output\OutputInterface $output )
execute ( ) Executes the export by loading the catalogue and writing messages from the defined domains to the defined file.
getBackend ( ) : boolean Returns whether the backend translations should be included in the export or not.
getFilename ( ) : string Returns the name of the file to export.
getFormat ( ) : string Returns the format, in which the catalogue should be exported.
getFrontend ( ) : boolean Returns whether the frontend translations should be included in the export or not.
getLocale ( ) : string Returns the locale of the package, which should be exported.
getPath ( ) : string Returns the path to the directory, in which the export should be located.
setBackend ( boolean $backend ) Sets whether the backend translations should be included in the export or not.
setFilename ( string $filename ) Sets the filename.
setFormat ( string $format ) Set the format, in which the catalogue should be exported.
setFrontend ( boolean $frontend ) Sets whether the frontend translations should be included in the export or not.
setLocale ( string $locale ) Sets the locale of the package, which should be exported.
setPath ( string $path ) Sets the path to the directory, in which the export should be located.

Private Methods

Méthode Description
getMessagesForDomain ( Symfony\Component\Translation\MessageCatalogueInterface $catalogue, $domain ) : array Gets the messages of a given catalogue and a given domain.
newFileDumper ( ) : Symfony\Component\Translation\Dumper\FileDumper Constructs a new file dumper depending on the defined format.
writeMessagesFile ( $messages ) Writes an array of translation messages to the defined file.

Method Details

__construct() public méthode

public __construct ( Translator $translator, Symfony\Component\Console\Output\OutputInterface $output )
$translator Symfony\Component\Translation\Translator
$output Symfony\Component\Console\Output\OutputInterface

execute() public méthode

Executes the export by loading the catalogue and writing messages from the defined domains to the defined file.
public execute ( )

getBackend() public méthode

Returns whether the backend translations should be included in the export or not.
public getBackend ( ) : boolean
Résultat boolean

getFilename() public méthode

Returns the name of the file to export.
public getFilename ( ) : string
Résultat string

getFormat() public méthode

Returns the format, in which the catalogue should be exported.
public getFormat ( ) : string
Résultat string

getFrontend() public méthode

Returns whether the frontend translations should be included in the export or not.
public getFrontend ( ) : boolean
Résultat boolean

getLocale() public méthode

Returns the locale of the package, which should be exported.
public getLocale ( ) : string
Résultat string

getPath() public méthode

If the path is not explicitly set, the current working directory will be returned.
public getPath ( ) : string
Résultat string

setBackend() public méthode

Sets whether the backend translations should be included in the export or not.
public setBackend ( boolean $backend )
$backend boolean

setFilename() public méthode

Sets the filename.
public setFilename ( string $filename )
$filename string

setFormat() public méthode

Set the format, in which the catalogue should be exported.
public setFormat ( string $format )
$format string

setFrontend() public méthode

Sets whether the frontend translations should be included in the export or not.
public setFrontend ( boolean $frontend )
$frontend boolean

setLocale() public méthode

Sets the locale of the package, which should be exported.
public setLocale ( string $locale )
$locale string

setPath() public méthode

Sets the path to the directory, in which the export should be located.
public setPath ( string $path )
$path string