class LocaleCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands
protected $languageManager
protected $configFactory
protected $moduleHandler
protected $state

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(LanguageManagerInterface $languageManager, ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, StateInterface $state)

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

LanguageManagerInterface
getLanguageManager()

No description

ConfigFactoryInterface
getConfigFactory()

No description

ModuleHandlerInterface
getModuleHandler()

No description

mixed
getState()

No description

check()

Checks for available translation updates.

update($options = ['langcodes' => self::REQ])

Imports the available translation updates.

export($langcode = null, $options = ['template' => false, 'types' => self::REQ])

Exports to a gettext translation file.

exportValidate(CommandData $commandData)

Assure that required options are set.

import($langcode, $file, $options = ['type' => 'not-customized', 'override' => self::REQ])

Imports to a gettext translation file.

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(LanguageManagerInterface $languageManager, ConfigFactoryInterface $configFactory, ModuleHandlerInterface $moduleHandler, StateInterface $state)

Parameters

LanguageManagerInterface $languageManager
ConfigFactoryInterface $configFactory
ModuleHandlerInterface $moduleHandler
StateInterface $state

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

protected LanguageManagerInterface getLanguageManager()

Return Value

LanguageManagerInterface

protected ConfigFactoryInterface getConfigFactory()

Return Value

ConfigFactoryInterface

ModuleHandlerInterface getModuleHandler()

Return Value

ModuleHandlerInterface

mixed getState()

Return Value

mixed

check()

Checks for available translation updates.

update($options = ['langcodes' => self::REQ])

Imports the available translation updates.

Parameters

$options

See also

\TranslationStatusForm::buildForm()
\TranslationStatusForm::prepareUpdateData()
\TranslationStatusForm::submitForm()

export($langcode = null, $options = ['template' => false, 'types' => self::REQ])

Exports to a gettext translation file.

See Drupal Core: \Drupal\locale\Form\ExportForm::submitForm

Parameters

$langcode
$options

Exceptions

Exception

exportValidate(CommandData $commandData)

Assure that required options are set.

Parameters

CommandData $commandData

import($langcode, $file, $options = ['type' => 'not-customized', 'override' => self::REQ])

Imports to a gettext translation file.

Parameters

$langcode
$file
$options

Exceptions

Exception