2017 © Pedro Peláez
 

library transarticles

Localization using db table as source for translated text

image

sirgrimorum/transarticles

Localization using db table as source for translated text

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 26 % Grown

The README.md

SirGrimorum's TransArticles

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

Localization using a datablase table for Laravel 5.6. Include a function to add Translation form DB to javascript., (*2)

Install

Via Composer, (*3)

``` bash $ composer require :sirgrimorum/transarticles, (*4)


Create Table ``` bash $ php artisan migrate

OPTIONAL: Publish configuration file, (*5)

``` bash $php artisan vendor:publish --tag=config, (*6)


## Usage Bring a translated article ``` php $text = TransArticles::get("scope.nickname");

OR ``` php $text = trans_article("scope.nickname");, (*7)


## Articles to JavaScript Load javascript object with all translations of a given scope ``` html {!! TransArticles::getjs('scope') !!} <script> (function() { alert(translations.scope.nickname); })(); </script>

Load javascript object with translated article, (*8)

``` html {!! TransArticles::getjs('scope.nickname') !!} , (*9)


## Blade directives Bring a translated article using the Blade directive ``` html @transarticles("scope.nickname")

Load javascript object with all translations of a given scope using the Blade directive, (*10)

``` html @transarticles_tojs('scope') , (*11)


Load javascript object with translated article using the Blade directive ``` html @transarticles_tojs('scope.nickname') <script> (function() { alert(translations.scope.nickname); })(); </script>

When using blade directives, remember to clear de view:cache after each change in the articles table:, (*12)

``` bash $php artisan view:clear, (*13)


## Seeding TransArticles installs orangehill/iseed to create seed files from the DataBase data. There are 2 new commands: To create seed files from the Articles table: ``` bash $php artisan transarticles:createseed

To create seed files from ALL the tables in de DataBase except the migrations table: ``` bash $php artisan transarticles:createseed --all, (*14)


To create seed files from ALL the tables in de DataBase except the migrations table without suffix and forcing overwrite of prior seed files: ``` bash $php artisan transarticles:createseed --all --force

Security

If you discover any security related issues, please email andres.espinosa@grimorum.com instead of using the issue tracker., (*15)

Credits

License

The MIT License (MIT). Please see License File for more information., (*16)

The Versions

03/04 2018

dev-master

9999999-dev http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

03/04 2018

1.2.6

1.2.6.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

03/04 2018

1.2.5

1.2.5.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

03/04 2018

1.2.4

1.2.4.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

03/04 2018

1.2.3

1.2.3.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

14/03 2018

1.2.2

1.2.2.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

14/03 2018

1.2.1

1.2.1.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

28/02 2018

1.2.0

1.2.0.0 http://desarrollo.grimorum.com/andres/transarticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

20/02 2018

1.1.0

1.1.0.0 http://desarrollo.grimorum.com/andres/TransArticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion

17/02 2018

1.0.0

1.0.0.0 http://desarrollo.grimorum.com/andres/TransArticles

Localization using db table as source for translated text

  Sources   Download

MIT

The Requires

 

The Development Requires

sirgrimorum transarticles localizarion