Esempio n. 1
0
 /**
  * @global Function T
  *
  * A global convenience method for the namespaced translator function. See Tee\Translator::translate for usage
  */
 function T()
 {
     $args = func_get_args();
     $string = array_shift($args);
     return \Tee\Translator::translate($string, $args);
 }
Esempio n. 2
0
<?php

require_once 'vendor/autoload.php';
use Tee\Translator as Trans;
Trans::configure(array('adapter' => '\\Tee\\Adapter\\JSON', 'adapterConfig' => array('translations' => 'example_translations/'), 'locale' => 'de'));
?>
<h1>Tee testing</h1>

<h2>Simple test</h2>

<pre>
<code>&lt;?= T("Hello world, my name is Kerbal") ?>
&lt;?= T("Hello world, my name is %s", 'James') ?>
&lt;?= T("Hello world, my name is %s", array('Bob')) ?></code>
&lt;?= T("Hello %s, my name is %s", array('Earth', 'Bob')) ?></code>
&lt;?= T("Hello %s, my name is %s", 'Earth', 'Bob') ?></code>
</pre>

<?php 
echo T("Hello world, my name is Kerbal");
?>
<br>
<?php 
echo T("Hello world, my name is %s", 'James');
?>
<br>
<?php 
echo T("Hello world, my name is %s", array('Bob'));
?>
<br>
<?php