PHP code example of fchris82 / jms-translation-bundle-fork

1. Go to this page and download the library: Download fchris82/jms-translation-bundle-fork library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fchris82 / jms-translation-bundle-fork example snippets




/**
 * @AltTrans("User has been created: <a href=""mailto:%email%"">%email%</a>", locale="en")
 * @AltTrans("A felhasználó létre lett hozva: <a href=""mailto:%email%"">%email%</a>", locale="hu")
 */
$this->trans('user.create.success.%email%', ['%email%' => $user->getEmail()]);



/** @TransArrayValues("error") */
$msgs = [
    /** @AltTrans("Error 1", locale="en") */
    'error.msg1',
    /** @AltTrans("Error 2", locale="en") */
    'error.msg2',
    /** @AltTrans("Error 3", locale="en") */
    'error.msg3',
];
/** @Ignore */
$this->trans($msgs[$errorId], [], "error");