// if there's no \0 inside the $str string, it's a singular
    // else it's a plural
    if (strpos($str, "") === FALSE) {
        $output .= "msgid \"{$str}\"\n";
        $output .= "msgstr \"\"\n";
    } else {
        list($singular, $plural) = explode("", $str);
        $output .= "msgid \"{$singular}\"\n";
        $output .= "msgid_plural \"{$plural}\"\n";
        $output .= "msgstr[0] \"\"\n";
        $output .= "msgstr[1] \"\"\n";
    }
    $output .= "\n";
    store($filename, $output, $filelist);
}
writeFiles();
return;
// These are never executed, you can run extractor.php on itself to test it
// $b, $f, $n, $s3 and $s4 should break
$a = ts("Test string 1");
//$b = ts("Test string 2 %string", array("%string" => "how do you do"));
$c = ts('Test string 3');
$d = ts("Special\ncharacters");
$e = ts('Special\\ncharacters');
//$f = ts("Embedded $variable");
$g = ts('Embedded $variable');
$h = ts("more \$special characters");
$i = ts('even more \\$special characters');
$j = ts("Mixed 'quote' \"marks\"");
$k = ts('Mixed "quote" \'marks\'');
$l = ts('This is some repeating text');
Exemple #2
0
    } else {
        $writable = "is <b>not</b>";
    }
    // DB credentials work
    $dbname = $_POST['dbname'];
    $uname = $_POST['dbuname'];
    $upass = $_POST['dbpwd'];
    $tableName = $_POST['dbtbl'];
    @($conn = mysqli_connect($dbname, $uname, $upass, $tableName));
    if (mysqli_connect_errno()) {
        echo "    <p>I couldn't make a MySQL connection. Here's the exact error.<br>";
        echo mysqli_connect_error() . "</p>";
        echo $form;
    } else {
        echo "    <p>Looks good so far, writing supporting files...</p>";
        writeFiles($dbname, $uname, $upass, $tableName);
        echo "    <p>Generating HTML pages...</p>";
        include '__generator.php';
        echo "    <p>Done! Here's a list of files.";
        include 'list.php';
        echo "    <p>Whilst working I created a couple of supporting files. <a href='cleanup.php'>Click here to remove them.</a></p>";
    }
    ?>

<?php 
    if (strlen($writeable) > 0) {
        ?>
 <p>Your file system <?php 
        echo $writeable;
        ?>
 writeable. I need to be able to write files to build your interface.</p> <?php