Location: PHPKode > scripts > Internationalization and Localization > internationalization-and-localization/file.php
<?php

require_once(dirname(__FILE__) . '/I18N.class.php');

// Instantiate the source

$dataSource =& new FileDataSource(dirname(__FILE__) . '/file/i18n.xml');

// Do our I18N stuff

$i18n =& new I18N();

$i18n->setLanguage('en');
$i18n->setDataSource($dataSource);

$languages =& $i18n->fetchLanguages();
$container =& $i18n->fetch();
$section =& $i18n->fetch('section');
$element =& $i18n->fetch('section', 'element');

// Print out results

echo '<b>ACTIVE LANGUAGES</b>';
echo '<hr />';
echo '<pre>';
print_r($languages);
echo '</pre>';
echo '<hr />';

echo '<b>CONTAINER</b>';
echo '<hr />';
echo '<pre>';
print_r($container);
echo '</pre>';
echo '<hr />';

echo '<b>SECTION</b>';
echo '<hr />';
echo '<pre>';
print_r($section);
echo '</pre>';
echo '<hr />';

echo '<b>ELEMENT</b>';
echo '<hr />';
echo '<pre>';
echo '<b>' . $element . '</b>';
echo '</pre>';
echo '<hr />';


?>
Return current item: Internationalization and Localization