Elgg  Version master
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Elgg\I18n\ReleaseCleaner Class Reference

Removes invalid language files from an installation. More...

Public Member Functions

 __construct (array $codes=[])
 Constructor. More...
 
 cleanInstallation (string $dir)
 Clean up within an installation. More...
 
 cleanLanguagesDir (string $dir)
 Clean up a languages dir. More...
 

Public Attributes

 $log = []
 

Protected Member Functions

 cleanupMissingTranslationParameters (string $directory, string $language_code)
 Try to cleanup translations with a different argument count than English as this can cause failed translations. More...
 
 cleanupEmptyTranslations (string $translation_file)
 Remove empty translations from a translation file. More...
 
 normalizeLanguageCode (string $code)
 Normalize a language code (e.g. More...
 

Detailed Description

Removes invalid language files from an installation.

Definition at line 14 of file ReleaseCleaner.php.

Constructor & Destructor Documentation

Elgg\I18n\ReleaseCleaner::__construct ( array  $codes = [])

Constructor.

Parameters
string[]$codes Valid language codes

Definition at line 31 of file ReleaseCleaner.php.

Member Function Documentation

Elgg\I18n\ReleaseCleaner::cleanInstallation ( string  $dir)

Clean up within an installation.

Parameters
string$dirThe installation dir
Returns
void

Definition at line 45 of file ReleaseCleaner.php.

Elgg\I18n\ReleaseCleaner::cleanLanguagesDir ( string  $dir)

Clean up a languages dir.

Parameters
string$dirLanguages dir
Returns
void

Definition at line 82 of file ReleaseCleaner.php.

Elgg\I18n\ReleaseCleaner::cleanupEmptyTranslations ( string  $translation_file)
protected

Remove empty translations from a translation file.

Parameters
string$translation_filepath to the translation file
Returns
void

Definition at line 166 of file ReleaseCleaner.php.

Elgg\I18n\ReleaseCleaner::cleanupMissingTranslationParameters ( string  $directory,
string  $language_code 
)
protected

Try to cleanup translations with a different argument count than English as this can cause failed translations.

Parameters
string$directoryLanguage directory to use for the English translation
string$language_codeLanguage core to try to cleanup
Returns
void

Definition at line 124 of file ReleaseCleaner.php.

Elgg\I18n\ReleaseCleaner::normalizeLanguageCode ( string  $code)
protected

Normalize a language code (e.g.

from Transifex)

Parameters
string$codeLanguage code
Returns
string

Definition at line 191 of file ReleaseCleaner.php.

Member Data Documentation

Elgg\I18n\ReleaseCleaner::$log = []

Definition at line 24 of file ReleaseCleaner.php.


The documentation for this class was generated from the following file: