PHP code example of pmdevelopment / translate-bundle

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

    

pmdevelopment / translate-bundle example snippets


    /*
     * Default Language
     */
    $translation = $this->get('pm_translate.services.translation_service')->translate($keywordName);
    
    /*
     * Custom Language
     */
    $translation = $this->get('pm_translate.services.translation_service')->translate($keywordName, 'en', 'fr');