PHP Class Sulu\Bundle\TranslateBundle\Translate\Export

Show file Open project: sulu/sulu Class Usage Examples

Public Methods

Method 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

Method 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 method

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

execute() public method

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

getBackend() public method

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

getFilename() public method

Returns the name of the file to export.
public getFilename ( ) : string
return string

getFormat() public method

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

getFrontend() public method

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

getLocale() public method

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

getPath() public method

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

setBackend() public method

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

setFilename() public method

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

setFormat() public method

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

setFrontend() public method

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

setLocale() public method

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

setPath() public method

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