Exemple #1
0
$success = $localizerLanguage->updateString("test_new", "boo", "ghost");
if (!$success) {
    echo "ERROR UPDATING STRING<br>";
}
$localizerLanguage->dumpToHtml();
echo "Move string forward (0 to 4)...<br>";
$localizerLanguage->moveString(0, 4);
$localizerLanguage->dumpToHtml();
echo "Move string foo to position 1...<br>";
$localizerLanguage->moveString('foo', 1);
$localizerLanguage->dumpToHtml();
echo "Delete foo..<br>";
$localizerLanguage->deleteString("foo");
$localizerLanguage->dumpToHtml();
echo "Delete position 2...<br>";
$localizerLanguage->deleteStringAtPosition(2);
$localizerLanguage->dumpToHtml();
echo "Save to xml...<br>";
$xml = $localizerLanguage->saveFile('xml');
echo "<pre>" . htmlspecialchars($xml) . "</pre>";
echo "Save as GS...<br>";
$gs = $localizerLanguage->saveFile('gs');
echo "<pre>" . htmlspecialchars($gs) . "</pre>";
echo "Load XML...<br>";
$xmlLang = new LocalizerLanguage('locals', 'xx');
$result = $xmlLang->loadFile('xml');
if (!$result) {
    echo "Error!  Could not load XML file.<br>";
} else {
    echo "Success!<br>";
}