PHP code example of kunstmaan / translator-bundle

1. Go to this page and download the library: Download kunstmaan/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/ */

    

kunstmaan / translator-bundle example snippets


new Kunstmaan\TranslatorBundle\KunstmaanTranslatorBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),

KunstmaanTranslatorBundle:
    resource: "@KunstmaanTranslatorBundle/Resources/config/routing.yml"
    prefix:   /{_locale}/
    

kunstmaan_translator:
    enabled:         true
    default_bundle:  own
    bundles:         []
    cache_dir:       %kernel.cache_dir%/translations
    managed_locales: []
    file_formats:    ['yml', 'yaml', 'xliff']
    debug:           defaults to the kernel.debug parameter (boolean)

kunstmaan_translator:
    managed_locales: ['en', 'fr', 'es']

kunstmaan_translator:
    default_bundle: own
    managed_locales: ['en', 'fr', 'es']
    debug: false

kunstmaan_translator:
    enabled: true
    default_bundle: custom
    bundles: ['MyCompanyCoolBundle', 'MyCompanyAwesomeBundle']
    managed_locales: ['en', 'fr', 'es']

bin/console doctrine:schema:update --force

Database schema updated successfully! "1" queries were executed

$kernel = new AppKernel('prod', false); // translations are cached an read from this cache

$kernel = new AppKernel('dev', true); // translations are always loaded from the stash (slower, more queries)
file_formats
bash
php-cs-fixer fix .