TranslatorAdapter
class TranslatorAdapter implements TranslatorAdapterInterface (View source)
Translator adapter that wraps the Laminas translator to provide the translator methods needed in concrete5.
Properties
| protected | $translator | 
Methods
No description
Sets the translator object.
Returns an instance of a translator object.
Get the locale from the translator object.
Sets the locale to the translator object.
Translate the given text. Returns the translated form of the text.
Translate the text either into the singular or the plural format depending on the given number. Returns the correct format of the text in its translated form.
Translate the given text with the given context. Returns the translated form of the text.
Formats the string in the with the PHP sprintf format with the given arguments.
Details
        
                            
    __construct(Translator $translator)
        
    
    No description
        
                            
    setTranslator(Translator $translator)
        
    
    Sets the translator object.
        
                            mixed
    getTranslator()
        
    
    Returns an instance of a translator object.
        
                            string
    getLocale()
        
    
    Get the locale from the translator object.
        
                            
    setLocale(string $locale)
        
    
    Sets the locale to the translator object.
        
                            string
    translate(string $text)
        
    
    Translate the given text. Returns the translated form of the text.
        
                            int
    translatePlural(string $singular, string $plural, int $number)
        
    
    Translate the text either into the singular or the plural format depending on the given number. Returns the correct format of the text in its translated form.
        
                            string
    translateContext(string $context, string $text)
        
    
    Translate the given text with the given context. Returns the translated form of the text.
        
                    protected        
    formatString(string $string, array $args)
        
    
    Formats the string in the with the PHP sprintf format with the given arguments.