Elgg  Version 5.1
Public Member Functions | List of all members
Elgg\I18n\NullTranslator Class Reference

A translator that does nothing except return the key that was requested. More...

Inheritance diagram for Elgg\I18n\NullTranslator:
Elgg\I18n\Translator

Public Member Functions

 translate ($message_key, $args=[], $language= '')
 
- Public Member Functions inherited from Elgg\I18n\Translator
 __construct (Config $config, LocaleService $locale)
 Constructor. More...
 
 getLoadedTranslations ()
 Get a map of all loaded translations. More...
 
 translate (string $message_key, array $args=[], string $language= '')
 Given a message key, returns an appropriately translated full-text string. More...
 
 addTranslation (string $country_code, array $language_array, bool $ensure_translations_loaded=true)
 Add a translation. More...
 
 getCurrentLanguage ()
 Get the current system/user language or 'en'. More...
 
 setCurrentLanguage (string $language=null)
 Sets current system language. More...
 
 detectLanguage ()
 Detect the current system/user language or false. More...
 
 bootTranslations ()
 Ensures all needed translations are loaded. More...
 
 loadTranslations (string $language)
 Load both core and plugin translations. More...
 
 registerTranslations (string $path, bool $load_all=false, string $language=null)
 When given a full path, finds translation files and loads them. More...
 
 reloadAllTranslations ()
 Reload all translations from all registered paths. More...
 
 getInstalledTranslations (bool $calculate_completeness=false)
 Return an array of installed translations as an associative array "two letter code" => "native language name". More...
 
 getLanguageCompleteness (string $language)
 Return the level of completeness for a given language code (compared to english) More...
 
 getMissingLanguageKeys (string $language)
 Return the translation keys missing from a given language, or those that are identical to the english version. More...
 
 languageKeyExists (string $key, string $language= 'en')
 Check if a given language key exists. More...
 
 getAvailableLanguages ()
 Returns an array of all available language keys. More...
 
 getAllowedLanguages ()
 Returns an array of allowed languages as configured by the site admin. More...
 
 registerLanguagePath (string $path)
 Registers a path for potential translation files. More...
 
 getLanguagePaths ()
 Returns a unique array with locations of translation files. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Elgg\I18n\Translator
 includeLanguageFile (string $path)
 Load cached or include a language file by its path. More...
 
 ensureTranslationsLoaded (string $language)
 Make sure translations are loaded. More...
 
- Protected Attributes inherited from Elgg\I18n\Translator
Config $config
 
LocaleService $locale
 
array $translations = []
 
string $defaultPath
 
string $current_language = null
 
array $allowed_languages
 
array $language_paths = []
 
bool $was_reloaded = false
 

Detailed Description

A translator that does nothing except return the key that was requested.

This translator is useful during development if you want to be able to easily tell what the available keys are for changing the wording of UI elements.

Since
1.10.0

Definition at line 14 of file NullTranslator.php.

Member Function Documentation

Elgg\I18n\NullTranslator::translate (   $message_key,
  $args = [],
  $language = '' 
)

Definition at line 19 of file NullTranslator.php.


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