PHP code example of gsferro / translation-solution-easy

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

    

gsferro / translation-solution-easy example snippets


          echo __("Nome Social"); 
          # ou
          {{ __("Termos de compromisso de uso") }}
          

        # crud-pessoa.php
        
        
        return [
            "index" => ":attribute recuperados(as) com sucesso",
        ];
        
        // uso
        echo __("crud-pessoa.index", ["attribute" => "Pessoa"]);
        

        
        
        if (app()->environment("testing")) {
                          ->middleware(["localeSessionRedirect", "localizationRedirect", "localeViewPath"])
                ->group(function () {
                    

        Route::middleware("web")
             ->namespace($this->namespace)
             ->group(base_path("routes/withLacale.php"));
    

        "translate-tables" => [
            "paises" => "nome", 
            // ou
            "servicos" => [
                "nome",
                "descricao",
                "observacoes",
            ]
        ],
    
bash
        php artisan gsferro:translate-files 
        
bash
        php artisan gsferro:configure-sqlite
         
bash
        php artisan gsferro:translate-tables
        
bash
composer  vendor:publish --provider="Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider"
php artisan vendor:publish --provider="Gsferro\TranslationSolutionEasy\Providers\TranslationSolutionEasyServiceProvider" --force

html
    <html lang="{{ strtolower(str_replace('_', '-', app()->getLocale())) }}">
    
bash
    php artisan migrate --path=database/migrations/translation
    
bash
        php artisan migrate --path=database/migrations/translation --database=<outra-conexão>
        
bash
    php artisan gsferro:configure-sqlite-migrate