HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/posscale/subdomains/xibo/vendor/gettext/gettext/src/Generators/CsvDictionary.php
<?php

namespace Gettext\Generators;

use Gettext\Translations;

class CsvDictionary extends Generator implements GeneratorInterface
{
    /**
     * {@parentDoc}.
     */
    public static function toString(Translations $translations)
    {
        $array = PhpArray::toArray($translations);

        //for a simple json translation dictionary, one domain is supported
        $values = current($array);

        // remove meta / header data
        if (array_key_exists('', $values)) {
            unset($values['']);
        }

        $handle = fopen('php://memory', 'w');

        //map to a simple csv dictionary (no plurals)
        foreach ($values as $original => $translated) {
            if (!isset($translated[1])) {
                $translated[1] = '';
            }
            fputcsv($handle, array($original, $translated[1]));
        }

        rewind($handle);
        $csv = stream_get_contents($handle);

        fclose($handle);

        return $csv;
    }
}