Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b6edeba02d72dbe4e46e3a0479e0ca12 > files > 13

ezcomponents-Translation-1.3.2-4.mga4.noarch.rpm

<?php
require_once 'tutorial_autoload.php';

$backend = new ezcTranslationTsBackend( dirname( __FILE__ ). '/translations' );
$backend->setOptions( array( 'format' => 'translation-[LOCALE].xml' ) );

$manager = new ezcTranslationManager( $backend );
$dutch = $manager->getContext( 'nl_NL', 'search' );
$norsk = $manager->getContext( 'nb_NO', 'search' );

$params = array( 'search_string' => 'appelmoes', 'matches' => 4 );
echo $dutch->getTranslation( "Search for '%search_string' returned %matches matches.", $params ), "\n";

$params = array( 'fruit' => 'epplet' );
echo $norsk->getTranslation( "The %fruit is round.", $params ), "\n";
?>