TranslationHelper
class TranslationHelper implements ProtectedContextAwareInterface (View source)
Translation helpers for Eel contexts
Constants
| I18N_LABEL_ID_PATTERN | 
                     
  | 
            
Methods
Get the translated value for an id or original label
Start collection of parameters for translation by id
Start collection of parameters for translation by original label
All methods are considered safe
Get the translated value for an id or original label
Translate by shorthand string
Create and return a TranslationParameterToken.
Details
        
                            string|null
    translate(string $id, string $originalLabel = null, array $arguments = [], string $source = 'Main', string $package = null, mixed $quantity = null, string $locale = null)
        
    
    Get the translated value for an id or original label
If only id is set and contains a translation shorthand string, translate according to that shorthand
In all other cases:
Replace all placeholders with corresponding values if they exist in the translated label.
        
                            TranslationParameterToken
    id(string $id)
        
    
    Start collection of parameters for translation by id
        
                            TranslationParameterToken
    value(string $value)
        
    
    Start collection of parameters for translation by original label
        
                            bool
    allowsCallOfMethod(string $methodName)
        
    
    All methods are considered safe
        
                    protected        string|null
    translateByExplicitlyPassedOrderedArguments(string $id, string $originalLabel = null, array $arguments = [], string|null $source = 'Main', string $package = null, mixed $quantity = null, string $locale = null)
        
    
    Get the translated value for an id or original label
Replace all placeholders with corresponding values if they exist in the translated label.
        
                    protected        string|null
    translateByShortHandString(string $shortHandString)
        
    
    Translate by shorthand string
        
                    protected        TranslationParameterToken
    createTranslationParameterToken(string $id = null, string $originalLabel = null)
        
    
    Create and return a TranslationParameterToken.