PHP code example of corbinjurgens / qtrans

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

    

corbinjurgens / qtrans example snippets


$get_page = request()->query('page', 'columns.users');
$shifts = [
	'signup' => 'forms.signup',
	'manage' => 'columns.users',
];
$page = $shifts[$get_page] ?? 'columns.users';

'processor' => [
	['escape', [] ], 
]

Corbinjurgens\QTrans\Html::custom('upper', function($string){
	return \Str::upper($string)
});

 "autoload": {
	"psr-4": {
		"Corbinjurgens\\QTrans\\": "packages/corbinjurgens/qtrans/src"
	},
	"files": {
		"packages/corbinjurgens/qtrans/src/helpers.php"
	}
},

composer dump-autoload
html
@php(qtrans()->shift(['forms.signup', 'columns.users']))
@php(qtrans()->shift(['common', 'address'], true))
@php(qtrans()->shift(['contact', 'private_contact'], true))

{{ qtrans('cell') }}

html
{{ ___('translation.key')->escape()->br() }}