PHP code example of amir-hossein5 / request-translator

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

    

amir-hossein5 / request-translator example snippets


composer 

php artisan translator:install

php artisan make:translation-file

->middleware('translate:mobile,cash,amount');

->middleware('translate:user.*,products.desk.price,products.*.price');

->middleware('translate_from:fa/digits_translation.php', 'translate: ....');

use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash', 'phone'
]);

->middleware('translate:userDigits,amount');

use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash' => 'fa/cash_translation.php', 
    'phone'
]);

use AmirHossein5\RequestTranslator\Facades\Translator;

Translator::for('userDigits', [
    'cash' => 'fa/cash_translation.php', 
    'phone',
    'number'
], 'test.php');
en_request_translation.php
en_request_translation
fa/cash_translation.php
test.php
LOCALE_request_translation.php