PHP Classes

File: src/Features/Translator.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu   Jaxon   src/Features/Translator.php   Download  
File: src/Features/Translator.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon
Call PHP classes from JavaScript using AJAX
Author: By
Last change:
Date: 5 years ago
Size: 1,010 bytes
 

Contents

Class file image Download
<?php

/**
 * Translator.php - Trait for translation functions
 *
 * Make functions of the utils classes available to Jaxon classes.
 *
 * @package jaxon-core
 * @author Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @copyright 2016 Thierry Feuzeu <thierry.feuzeu@gmail.com>
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
 * @link https://github.com/jaxon-php/jaxon-core
 */

namespace Jaxon\Features;

trait
Translator
{
   
/**
     * Get a translated string
     *
     * @param string $sText The key of the translated string
     * @param array $aPlaceHolders The placeholders of the translated string
     * @param string|null $sLanguage The language of the translated string
     *
     * @return string The translated string
     */
   
public function trans($sText, array $aPlaceHolders = [], $sLanguage = null)
    {
        return
jaxon()->di()->getTranslator()->trans($sText, $aPlaceHolders, $sLanguage);
    }
}