PHP code example of docteurklein / translator-bundle
1. Go to this page and download the library: Download docteurklein/translator-bundle 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/ */
docteurklein / translator-bundle example snippets
php
// app/AppKernerl.php
public function registerBundles()
{
$bundles = array(
// ...
new Knp\Bundle\TranslatorBundle\KnpTranslatorBundle,
// ...
);
// ...
}
php
$this->get('translator.writer')->write('the key to translate', 'the translated string', 'messages', 'en');