PHP code example of waterloomatt / translation

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

    

waterloomatt / translation example snippets


'providers' => [
  Waterloomatt\Translation\Providers\TranslationServiceProvider::class
 
return [
  'pageTitle'                                   => 'My Application!'  // Applies to all pages
  'controller:search_key:pageTitle'             => 'Search',          // Applies to /search/{any_action}
  'action:index_key:pageTitle'                  => 'All Index Pages!',// Applies to /{any_controller}/index
  'controller:user_action:update_key:pageTitle' => 'Update User',     // Applies to user/update
];
 
return [
  'controller:search_key:pageTitle'               => 'Search',    
  'controller:search_action:index_key:pageTitle'  => 'Search',    // this one!
];
 
return [
  'action:index_key:pageTitle'                    => 'Search',  
  'pageTitle'                                     => 'Search',    // this one!
];
 
return [
  'controller:search_action:result_key:pageTitle' => 'Search',    
  'controller:search_action:index_key:pageTitle'  => 'Search',    // this one!
];
 
return [
  'controller:search_key:pageTitle'               => 'Search',    
  'action:index_key:pageTitle'                    => 'Search',    // this one!
];