PHP code example of forxer / generic-term-translations-for-laravel

1. Go to this page and download the library: Download forxer/generic-term-translations-for-laravel 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/ */

    

forxer / generic-term-translations-for-laravel example snippets


// "en" locale
trans('action.add_something', [
    'something' => 'a post',
]);

// return: "add a post"

// "fr" locale
trans('action.add_something', [
    'something' => 'un article',
]);

// return: "ajouter un article"

trans('action.delete_something', [
    'something' => e($post->title),
]);

// "en" locale
trans('misc.all'); // return: "all"

trans('misc.all_fem'); // return: "all"

// "fr" locale
trans('misc.all'); // return: "tous"

trans('misc.all_fem'); // return: "toutes"