class TranslationCompiler implements FilterInterface (View source)

Generate compiled .mo translation files from source .po translation files.

Properties

protected bool $checkEditDate

Should the compiled .mo translation files be created only if they don't exist, or if they are older than the source .po translation files?

protected OutputInterface $output
protected VolatileDirectory $volatileDirectory
protected Filesystem $fs

Methods

__construct(bool $checkEditDate, OutputInterface $output, VolatileDirectory $volatileDirectory, Filesystem $fs)

Initialize the instance.

apply(PackerFile $file)

Process a file/directory.

bool
isMONewerThanPO(PackerFile $file)

Check if there's already a .mo file, and that it's not older than the .po file.

string
createMO(PackerFile $sourceFile)

No description

Details

__construct(bool $checkEditDate, OutputInterface $output, VolatileDirectory $volatileDirectory, Filesystem $fs)

Initialize the instance.

Parameters

bool $checkEditDate

should the compiled .mo translation files be created only if they don't exist, or if they are older than the source .po translation files?

OutputInterface $output
VolatileDirectory $volatileDirectory
Filesystem $fs

PackerFile[] apply(PackerFile $file)

Process a file/directory.

Parameters

PackerFile $file

the file to be processed

Return Value

PackerFile[]

the resulting list of files after processing

See also

FilterInterface::apply

protected bool isMONewerThanPO(PackerFile $file)

Check if there's already a .mo file, and that it's not older than the .po file.

Parameters

PackerFile $file

the .po file

Return Value

bool

return true if the .mo file already exists and it's newer than the .po file.

protected string createMO(PackerFile $sourceFile)

No description

Parameters

PackerFile $sourceFile

Return Value

string

Exceptions

RuntimeException