Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How can I use CSV Translate Adapter?

I'm finding nothing information about it (on this forum and in other places). And I couldn't fully undestand the source code correctly, to be able to find to find a solution by myself... And...I hope for your help :) Thank you!



42.6k
Accepted
answer
$translate = new Phalcon\Translate\Adapter\Csv([
    'file' => 'fr_FR.csv', // required
    'delimiter' => ',', // optional, default - ;
    'length' => '4096', // optional, default - 0
    'enclosure' => '^', // optional, default - "
]);

echo $translate->_('Hello');
echo $translate->_('My name is %name%', array('name' => 'John Doe')); //Je m'appelle John Doe