2017 © Pedro Peláez
 

package laravel-translate

Package for Laravel translate

image

aktaa/laravel-translate

Package for Laravel translate

  • Friday, May 11, 2018
  • by mohammadaktaa1995
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel Translatable

This package to make translate easly in laravel and to save your translate words in datatabse with many usefull functions., (*1)

Install

Via Composer, (*2)

``` bash $ composer require Aktaa/laravel-translate, (*3)


## Usage You shoud publish provider to use package without errors. ``` bash $ php artisan vendor:publish --provider=Aktaa\translatable\TranslatableServiceProvider

After that use this command ti initialize package's files (Model,Provider,viewComposer,helper file,translate table migration), (*4)

``` bash $ php artisan make:translate-init --langs=en,ar, (*5)

The name of Model will be Translate by default if you want to change it you just write this command istead of the above,
and you want to deploy it in another directory you just add option ``` bash --dir=folder ```.

``` bash
$ php artisan make:translate-init Example --langs=en,ar --dir=Models

The file generated is:, (*6)

App\Helper\Helpers.php,, (*7)

App\Models\Translate.php,, (*8)

App\Providers\ComposerServiceProvider.php,, (*9)

database\migrations\2018_05_09_124224_create_translates_table.php,, (*10)

resources\lang{lang}\words.php,, (*11)

The words file is if you want to use php helper function trans('words.example')., (*12)

you should put in app.config file., (*13)

App\Providers\ComposerServiceProvider::class

and, (*14)

Aktaa\translatable\TranslatableServiceProvide::class  

Facade:, (*15)

   'Translatable' => Aktaa\translatable\Facades\Translatable::class,
   ```
 The helper function is
``` php
translate($word,$lang,$default);
ex:translate('hello_word',Translatable::getCurrentLocale(),'Hello World!);

$default the word appear if the word you entered doesn't exist., (*16)

After all of this you will be able to use it go to this url: php http://localhost/your-project-name/public/{lang}/translates, (*17)

alt text, (*18)

alt text, (*19)

alt text, (*20)

The Versions

11/05 2018

dev-master

9999999-dev https://github.com/mohammadaktaa1995/laravel-translatable

Package for Laravel translate

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mohammad Aktaa

translate aktaa

11/05 2018

dev-dev

dev-dev https://github.com/mohammadaktaa1995/laravel-translatable

Package for Laravel translate

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mohammad Aktaa

translate aktaa